RE: Re[2]: backslashes and r-strings r"abc"
"Mark Hahn" <[email protected]> Tue, 27 Jul 2004 11:17:29 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <004101c47405$fa2e3fd0$0b01a8c0@mark> |
Lenard Lindstrom wrote: >> Mark Hahn <[email protected]>: >> >>> Does anyone see any reason to preserve Python's restriction on not >>> having a backslash as the last character of a r-string? >> >> The reason it's there is because, even inside r-strings, backslashes >> still escape quote characters. To remove it, you'd have to either >> disallow quotes embedded in r-strings, or come up with some >other way >> of flagging them without compromising the rawness quality of >> r-strings. >> >Backslashes are not removed in raw strings. So a >backslash-quote gives you that, a backslash-quote. Hardly >useful for including double quotes in a single quoted string >or vice versa. Well, it IS useful if the quote character you need happens to follow a backslash. :-) No wonder I didn't understand what "Python in a nutshell" was explaining. It makes no sense whatsoever. What in the hell was Guido thinking? I can understand Greg's confusion. His brain turned the mess into something that made sense, even if it was wrong.