Python & unicode

Kent Johnson kent3737 at yahoo.com
Tue Jan 11 12:21:45 EST 2005


michele.simionato at gmail.com wrote:
> Kent:
> 
>>I don't think so. You have hacked an attribute with latin-1
> 
> characters in it, but you
> 
>>haven't actually created an identifier.
> 
> 
> No, I really created an identifier. For instance
> I can create a global name in this way:
> 
> 
>>>>globals()["è"]=1
>>>>globals()["è"]
> 
> 1

Maybe I'm splitting hairs but to me an identifier is a syntactical element that can be used in 
specific ways. For example the syntax defines
attributeref ::=
              primary "." identifier
so if identifiers can contain latin-1 characters you should be able to say
C.è=1

Kent

> 
> 
>>According to the language reference, identifiers can only contain
> 
> letters a-z and A-Z,
> 
>>digits 0-9 and underscore.
>>http://docs.python.org/ref/identifiers.html
> 
> 
> The parser has this restriction, so it gets confused if it finds "è".
> But the underlying
> implementation just works for generic identifiers.
> Michele Simionato
> 



More information about the Python-list mailing list