unicodedata implementation

"Martin v. Löwis" martin at v.loewis.de
Thu Feb 22 13:09:03 EST 2007


James Abley schrieb:
> So from my understanding of the Unicode (3.2.0) spec, the code point
> 0x325F has a numeric property with a value of 35, but the python (2.3
> and 2.4 - I haven't put 2.5 onto my box yet) implementation of
> unicodedata disagrees, presumably for good reason.
> 
> I can't see where I'm going wrong.

You might not be wrong at all. CPython has a hard-coded list for the
numeric mapping (see Object/unicodectype.c), and that hadn't been
updated even when the rest of the character database was updated.
Patch #1494554 corrected this and updated the numeric properties to
Unicode 4.1, for Python 2.5.

There is still a patch pending generating this function, instead
of maintaining it manually.

HTH,
Martin



More information about the Python-list mailing list