[Python-ideas] Support Unicode code point notation

Stephen J. Turnbull stephen at xemacs.org
Sat Jul 27 18:46:28 CEST 2013


Steven D'Aprano writes:

 > I propose that Python strings support this as the preferred escape notation for Unicode code points:
 > 
 > '\U+03C0'
 > => 'π'

-1.  Because:

 > The existing \U and \u variants must be kept for backwards
 > compatibility, but should be (mildly) discouraged in new code.

OTOH, supporting "\N{U+03C0}" seems harmless, if not particularly useful,
to me.  However, I don't find it hard to imagine that some people
would use it in preference to the \U and \u escpes, despite being
somewhat verbose.


More information about the Python-ideas mailing list