[Python-Dev] Python and the Unicode Character Database

Lennart Regebro regebro at gmail.com
Wed Dec 1 13:58:01 CET 2010


On Tue, Nov 30, 2010 at 09:23, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Sure you can.  In Python program text, all keywords will be ASCII

Yes, yes, sure, but not the contents of variables,

> I see no reason not to make a similar promise for numeric literals.

Wait what, literas? The example was

>>> float('١٢٣٤.٥٦')

Which doesn't have any numeric literals in them at all. Do that work?
Nope, it's a syntax error. Too badm that would have been cool, but whatever.

Why would this be a problem:

>>> T1234 = float('١٢٣٤.٥٦')
>>> T1234
1234.56

But this OK?

>>> T١٢٣٤ = float('1234.56')
>>> T١٢٣٤
1234.56

I don't see that.


Should we bother to implement ١٢٣٤.٥٦ as a literal equivalent to
1234.56? Well, not unless somebody askes for it, or it turns out to be
easy. :-) But that's another question.


More information about the Python-Dev mailing list