Title: Mail

I'm using Python 2.5 on Windows XP Pro.

While testing for strings, I got the following result:

 

>>> r'c:\'
SyntaxError: EOL while scanning single-quoted string

>>> r'c:\nwin'
'c:\\nwin'

>>> r"c:\"
SyntaxError: EOL while scanning single-quoted string

>>> r'\n'
'\\n'

>>> r'\"'
'\\"'

It seemed that when a back slash is inside the raw string,

it is correctly recognized as a normal character, not translated;

but when put to the end, it raise an error.

 

And the message looks so strange:

 

>>> r"c:\"
SyntaxError: EOL while scanning single-quoted string

 

what does this message mean? I'm not using any single quote in the statement.

It this a bug or by design?

 

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

Reply via email to