unicodedata name for \u000a

Peter Otten __peter__ at web.de
Sun Aug 22 12:00:54 EDT 2004


Tor Iver Wilhelmsen wrote:

> "Martin v. Löwis" <martin at v.loewis.de> writes:
> 
>> No. <control> is not a character name. The unicodedata.name function
>> returns the official character name, so it MUST NOT return an alias
>> (which rules out your second alternative).
> 
> Then why not return None or the empty string instead of raising an
> exception?

What's wrong with

>>> import unicodedata
>>> unicodedata.name(u"\u000a", "my default value")
'my default value'

Peter




More information about the Python-list mailing list