New submission from STINNER Victor victor.stin...@haypocalc.com:
len(ur'\u') == len(u'\u') == 1
len(ur'\U0010') == len(u'\U0010') == 1
but
len(ur'\n'), len(u'\n')
(2, 1)
len(ur'\x00'), len(u'\x00')
(4, 1)
\u and \U should not be interpreted in raw Unicode strings.
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
This has changed in python 3, and is even documented:
http://docs.python.org/dev/py3k/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit
(6th bullet)
Python 2.x could not be changed, for compatibility reasons.
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
Python 2.x could not be changed, for compatibility reasons.
Well, it is not a bug because it is documented!
When an 'r' or 'R' prefix is used in conjunction with a 'u' or 'U' prefix,
then the \u and \U escape