[issue18614] Enhanced \N{} escapes for Unicode strings

2013-08-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with the proposal. Some of the code seems redundant with code we already have. In Python, I would write def codepoint_from_U_notation(name, namelen): if not (4 <= namelen <= 6): raise return chr(int(name, 16)) maybe with try-except to re-write err

[issue18614] Enhanced \N{} escapes for Unicode strings

2013-08-01 Thread Matthew Barnett
Matthew Barnett added the comment: I've attached a patch for this. -- keywords: +patch nosy: +mrabarnett Added file: http://bugs.python.org/file31112/issue18614.patch ___ Python tracker

[issue18614] Enhanced \N{} escapes for Unicode strings

2013-08-01 Thread Steven D'Aprano
New submission from Steven D'Aprano: As per the discussion here: http://mail.python.org/pipermail/python-ideas/2013-July/022419.html \N{} escapes should support the Unicode code point notation U+ (where there are four, five or six hex digits after the U+). E.g. '\N{U+03BB}' => 'λ' unicod