Unrecognized escape sequences in string literals

John Nagle nagle at animats.com
Mon Aug 10 08:03:14 CEST 2009


Carl Banks wrote:
> IOW it's an error-prone mess.  It would be better if Python (like C)
> treated \ consistently as an escape character.  (And in raw strings,
> consistently as a literal.)

    Agreed.  For one thing, if another escape character ever has to be
added to the language, that may change the semantics of previously
correct strings.  If "\" followed by a non-special character is treated
as an error, that doesn't happen.

					John Nagle



More information about the Python-list mailing list