Raw string substitution problem

Richard Brodie R.Brodie at rl.ac.uk
Thu Dec 17 11:24:32 EST 2009


"Alan G Isaac" <alan.isaac at gmail.com> wrote in message 
news:qemdnRUT0JvJ1LfWnZ2dnUVZ_vqdnZ2d at rcn.net...

> Naturally enough.  So I think the right answer is:
>
> 1. this is a documentation bug (i.e., the documentation
>    fails to specify unexpected behavior for raw strings), or
> 2. this is a bug (i.e., raw strings are not handled correctly
>    when used as replacements)

<neo> There is no raw string. </neo>

A raw string is not a distinct type from an ordinary string
in the same way byte strings and Unicode strings are. It
is a merely a notation for constants, like writing integers
in hexadecimal.

>>> (r'\n', u'a', 0x16)
('\\n', u'a', 22)








More information about the Python-list mailing list