Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?]
python.list at tim.thechases.com
Sun Jul 19 21:55:20 CEST 2015
On 2015-07-20 04:07, Chris Angelico wrote:
> The int() and float() functions accept, if I'm not mistaken,
> anything with Unicode category "Nd" (Number, decimal digit). In
> your examples, the fraction (U+215B) is No, and the Roman numerals
> (U+2168, U+2182) are Nl, so they're not supported. Adding support
> for these forms might be accepted as a feature request, but it's
> not a bug.
Ah, that makes sense. Some simple testing (thanks, unicodedata
module) supports your conjecture.
It's not a particularly big deal so not really worth the brain-cycles
to add support for them. Just upon hearing "Python's int() does
smart things with Unicode characters", those were some of my first
characters to try. The failure struck me as odd until you explained
the simple difference.
More information about the Python-list