break unichr instead of fix ord?

"Martin v. Löwis" martin at v.loewis.de
Thu Aug 27 07:51:29 CEST 2009


> My apologies for the red herring.  I was working from
> a comment in my replacement ord() function.  I dug up
> an old copy of Python 2.4.3 and could not reproduce it
> there either so I have no explanation for the comment
> (which I wrote).  Python 2.3 maybe?

No. The behavior you observed would only happen on
a wide Unicode build (e.g. on Unix).

> But regardless, the significant question is, what is
> the reason for having ord() (and unichr) not work for
> surrogate pairs and thus not usable with a large number
> of unicode characters that Python otherwise supports?

See PEP 261, http://www.python.org/dev/peps/pep-0261/
It specifies all this.

Regards,
Martin



More information about the Python-list mailing list