[Python-Dev] unicodedata.numeric (was RE: stupid floating point
question...)
M.-A. Lemburg
mal@lemburg.com
Fri, 29 Sep 2000 00:38:47 +0200
Tim Peters wrote:
>
> [The Ping of Death suggests unicodedata.rational]
> > >>> unicodedata.rational(u"\N{VULGAR FRACTION ONE THIRD}")
> > (1, 3)
>
> [Timmy replies]
> > Perfect -- another great name. Beats all heck out of
> > unicodedata.vulgar() too.
>
> [/F inquires]
> > should I interpret this as a +1, or should I write a PEP on
> > this topic? ;-)
>
> I'm on vacation (but too ill to do much besides alternate sleep & email
> <snarl>), and I'm not sure we have clear rules about how votes from
> commercial Python developers count when made on their own time. Perhaps a
> meta-PEP first to resolve that issue?
>
> Oh, all right, just speaking for myself, I'm +1 on The Ping of Death's name
> suggestion provided this function is needed at all. But not being a Unicode
> Guy by nature, I have no opinion on whether the function *is* needed (I
> understand how digits work in American English, and ord(ch)-ord('0') is the
> limit of my experience; can't say whether even the current .numeric() is
> useful for Klingons or Lawyers or whoever it is who expects to get a numeric
> value out of a character for 1/2 or 1/3).
The reason for "numeric" being available at all is that the
UnicodeData.txt file format specifies such a field. I don't believe
anyone will make serious use of it though... e.g. 2² would parse as 22
and not evaluate to 4.
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/