Benji York wrote:
> Ron Adam wrote:
>> The following inconsistency still bothers me, but I suppose it's an edge 
>> case that doesn't cause problems.
>>
>>  >>> print r"hello world\"
>>    File "<stdin>", line 1
>>      print r"hello world\"
>>                          ^
>> SyntaxError: EOL while scanning single-quoted string
> 
>> In the first case, it's treated as a continuation character even though 
>> it's not at the end of a physical line. So it gives an error.
> 
> No, that is unrelated to line continuation.  The \" is an escape 
> sequence, therefore there is no double-quote to end the string literal.

Are you sure?


 >>> print r'\"'
\"

It's just a '\' here.

These are raw strings if you didn't notice.


Cheers,
    Ron

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to