[Python-Dev] Divorcing str and unicode (no more implicitconversions).

Walter Dörwald walter at livinglogic.de
Wed Oct 26 09:31:47 CEST 2005


Am 25.10.2005 um 23:40 schrieb Josiah Carlson:

> [...]
> Identically drawn glyphs are a problem, and pretending that they  
> aren't
> a problem, doesn't make it so.  Right now, all possible name glyphs  
> are
> visually distinct, which would not be the case if any unicode  
> character
> could be used as a name (except for numerals).  Speaking of which,  
> would
> we then be offering support for arabic/indic numeric literals, and/or
> support it in int()/float()?

It's already supported in int() and float()

 >>> int(u"\u136c\u2082")
42
 >>> float(u"\u0664\u09e8")
42.0

But not as literals:

# -*- coding: unicode-escape -*-

print \u136c\u2082

This gives (on the Mac):

   File "encoding.py", line 3
     print ፬₂
           ^
SyntaxError: invalid syntax

> [...]

Bye,
    Walter Dörwald



More information about the Python-Dev mailing list