Re[2]: backslashes and r-strings r"abc"

Lenard Lindstrom <[email protected]> Tue, 27 Jul 2004 09:18:42 -0700 (Pacific Daylight Time)
Newsgroups gmane.comp.lang.prothon.user
Message-ID <Mahogany-0.66.0-4294580231-20040727-095607.00@pop3.norton.antivirus>
On Tue, 27 Jul 2004 14:15:29 +1200 Greg Ewing <[email protected]> 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.

Lenard Lindstrom