>>> r"a\"
  SyntaxError: EOL while scanning string literal (<pyshell#45>, line 1)

It seems the parser is interpreting the backslash as an escape
character in a raw string if the backslash is the last character.
Is this expected?

Yep...as documented[1], "even a raw string cannot end in an odd number of backslashes".

-tkc


[1]
http://docs.python.org/reference/lexical_analysis.html




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to