Wrong unichr docstring in 2.7

jmfauth wxjmfauth at gmail.com
Sun Aug 22 11:17:09 CEST 2010


I think there is a small point here.

>>> sys.version
2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
>>> print unichr.__doc__
unichr(i) -> Unicode character

Return a Unicode string of one character with ordinal i; 0 <= i <=
0x10ffff.
>>> # but
>>> unichr(0x10fff)
Traceback (most recent call last):
  File "<psi last command>", line 1, in <module>
ValueError: unichr() arg not in range(0x10000) (narrow Python
build)

Note:

I find
0x0 <= i <= 0xffff
more logical than
0 <= i <= 0xffff

(orange-apple comparaison)

Ditto, for Python 2.6.5

Regards,
jmf





More information about the Python-list mailing list