R. David Murray <rdmur...@bitdance.com> added the comment:

I think perhaps the language in the language reference is a bit misleading.  
The purpose of the raw string algorithm is that any characters in the string be 
copied literally into the string object.  That is, \" "escapes" the " not so 
that you can write r"\"", but so that the string object produced by that 
literal (or by the literal r'\"') contains the two characters \".

So, it is certainly true that raw string will *not* be changed to make \ not 
escape quotes.

I can't remember where I read this, but the reason that a trailing \ is invalid 
has to do with the way the parser parses strings/raw strings.  So any alternate 
"more raw" string type would have to contend with the same parser issues that 
lead to the exiting restrictions on raw strings.

Unless someone wants to do a deep dive into the parser and figure out why 
things are they way they are and how to fix it, I think this issue should be 
reclosed.  Note that even if a solution can be found, if it significantly 
complicates the parser it will probably be rejected.  And I suspect it would, 
otherwise things probably wouldn't work the way they currently do.  However, 
perhaps someone can spot a clever solution that was overlooked in the original 
implementation.

----------
nosy: +r.david.murray
versions:  -Python 2.5, Python 2.6, Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1271>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to