RE: Re[2]: backslashes and r-strings r"abc"
"Mark Hahn" <[email protected]> Thu, 29 Jul 2004 20:35:08 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <000501c475e6$36a494a0$0d01a8c0@MarkVaio> |
Greg Ewing wrote: > > 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. > > You're right, it's not very useful. I hadn't considered that. > > So it looks like the best thing is just to not treat > backslashes in any special way at all in an r-string. That's what I'm proposing in the Wiki, except I am going to support continuation at the end of the line. > Mark Hahn <[email protected]>: > > > What in the hell was Guido thinking? > > I think it's a result of just doing whatever was easiest to > implement. Python scans Raw strings using the same regular > expression as normal strings, and the post-processing step > which interprets \n etc. is omitted. > > If you're willing to scan raw strings using a different > RE, the problem is easily avoided. What's an RE? (Just kidding). I have custom C code for each of the string types. I'm just an old-fashioned hacker. :-)