On Fri, Apr 19, 2013 at 2:33 AM, Guenter Milde <milde@users.sf.net> wrote:> Simple changes to the script yields this very fast way to compute the
> delimiters:

> ch = unichr if sys.version_info < (3,) else chr
> delimiters = ''.join([
> † † ch(45), # hyphen-minus
> † † ch(47), # solidus
> † † ch(65380), # halfwidth ideographic comma
> † † ch(65381), # halfwidth katakana middle dot
> ])

But this is not a computation according to the specs but merely a different
way to store the hard-coded values.

The re-computation code has two purposes:

Thanks, GŁnter, for these interesting comments.† I understand your point of view.

> As long as Docutils supports Python versions prior to 2.7, a common
codebase for 2.x and 3.x would require so many switches and ugly
workarounds that it would complicate maintenance in an unsupportable way.

I agree.† Happily, Leo only supports 2.6 and above, so my task is easier.

I recommend an approach with a common front-end and two sub-libraries to
import 2.x or 3.x versions of the modules. This should save a lot of work
when trying to keep the "minimal DU" in sync with Docutils.

Thanks for this advice.† I might actually take it :-)† There seems to be no perfect solution: using two sub-libraries will almost double the size of the code that needs to be added to the Leo distro, but it may be better than the alternatives.† It's certainly the easy way.† Otoh, getting a dual-code version of 0.10 will be good enough for the foreseeable future.† It's a close call for me.