Stephen J. Turnbull wrote:
Jim Jewett writes:

 > I realize that this is the traditional escape form, but I wonder if it
 > might be better to just use the character names instead of the hex
 > character codes.

That would require changing the parser, no?  Of all types, string had
better roundtrip through repr()!

The string parser has understood Unicode names for quite some time (examples use 2.5.1):

>>> print u"\N{GREEK SMALL LETTER ALPHA}"
α
>>> print u"\N{GREEK CAPITAL LETTER ALPHA}"
Α
>>> print u"\N{GREEK CAPITAL LETTER ALPHA WITH TONOS}"
Ά

Using the names gets fairly verbose compared to the hex escapes though:

>>> u"\N{GREEK SMALL LETTER ALPHA}"
u'\u03b1'
>>> u"\N{GREEK CAPITAL LETTER ALPHA}"
u'\u0391'
>>> u"\N{GREEK CAPITAL LETTER ALPHA WITH TONOS}"
u'\u0386'

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to