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

Tim Peters tim_one@email.msn.com
Thu, 28 Sep 2000 16:52:28 -0400


[/F]
> ...but maybe we can add an alternate API that returns the
> *exact* fraction (as a numerator/denominator tuple)?
>
> >>> unicodedata.numeric2(u"\N{VULGAR FRACTION ONE THIRD}")
> (1, 3)
>
> (hopefully, someone will come up with a better name)

[The Ping of Death]

LOL!  Great name, Ping.

> unicodedata.rational might be an obvious choice.
>
>     >>> unicodedata.rational(u"\N{VULGAR FRACTION ONE THIRD}")
>     (1, 3)

Perfect -- another great name.  Beats all heck out of unicodedata.vulgar()
too.

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