Best Practice Question

Jean-Michel Pichavant jeanmichel at sequans.com
Wed Feb 6 11:10:42 CET 2013


----- Original Message -----
> 
> [...]
> > By the way, did someone ever notice that r'\' fails ? I'm sure
> > there's a
> > reason for that... (python 2.5) Anyone knows ?
> > 
> > r'\'
> > SyntaxError: EOL while scanning single-quoted string
> > 
> >
> "Even in a raw string, string quotes can be escaped with a backslash,
> but the backslash remains in the string; for example, r"\"" is a
> valid
> string literal consisting of two characters: a backslash and a double
> quote; r"\" is not a valid string literal (even a raw string cannot
> end
> in an odd number of backslashes). Specifically, a raw string cannot
> end
> in a single backslash (since the backslash would escape the following
> quote character). " -- python docs
> --
> http://mail.python.org/mailman/listinfo/python-list
> 

Thanks for the pointer.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list