raw strings and \

Blackbird fake at nospam.no
Sun Mar 5 17:58:44 CET 2006


plahey at alumni.caltech.edu wrote:
> Hi Duncan,
>
> thanks for the reply.  I figured that this was a technical problem
> associated with the parser.
>
> This one is going on my Python gotchas list.  It is really silly from
> an end user perspective to have \ not special in raw strings _except_
> if it is the last character.

But at the parsing stage, it *is* somewhat special, even if it is not the
last charater.  E.g,

a = r'check \' this'
print a

The second quote is not regarded as ending the string literal.







More information about the Python-list mailing list