[Python-Dev] unicodedata.numeric (was RE: stupid floating point question...)

Tim Peters tim_one@email.msn.com
Thu, 28 Sep 2000 18:12:23 -0400


[tim]
> leaving-it-up-to-/f-to-decide-what-.rational()-should-return-for-pi-
>     ly y'ts  - the timmy of death

[/F]
> oh, the unicode folks have figured that one out:
>
> >>> unicodedata.numeric(u"\N{GREEK PI SYMBOL}")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: not a numeric character

Ya, except I'm starting to suspect they're not floating-point experts
either:

>>> unicodedata.numeric(u"\N{PLANCK CONSTANT OVER TWO PI}")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: not a numeric character
>>> unicodedata.numeric(u"\N{EULER CONSTANT}")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: not a numeric character
>>> unicodedata.numeric(u"\N{AIRSPEED OF AFRICAN SWALLOW}")
UnicodeError: Unicode-Escape decoding error: Invalid Unicode Character Name
>>>