[Python-Dev] \u and \U escapes in raw unicode string literals

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 11 03:30:37 CEST 2007


Martin v. Löwis wrote:
> why should you be able to get a non-ASCII character
> into a raw Unicode string?

The analogous question would be why can't you get a
non-Unicode character into a raw Unicode string. That
wouldn't make sense, since Unicode strings can't even
hold non-Unicode characters (or at least they're not
meant to).

But it doesn't seem unreasonable to want to put
Unicode characters into a raw Unicode string. After
all, if it only contains ASCII characters there's
no need for it to be a Unicode string in the first
place.

--
Greg


More information about the Python-Dev mailing list