is this a Python bug?
Fredrik Lundh
effbot at telia.com
Wed Feb 16 12:19:12 EST 2000
More information about the Python-list mailing list
Wed Feb 16 12:19:12 EST 2000
- Previous message (by thread): is this a Python bug?
- Next message (by thread): is this a Python bug?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Brian Langenberger <brian at brian.cbs.umn.edu> wrote: > : MZ> Raw strings cannot end with a backslash. > > : They can. But only with an even number of them. > > I'm assuming there's some clever and important reason for this. > But for the life of me I can't figure out what it is. > Could someone enlighten me as to the reason? :) a Python string literal consists of an opening quote, a sequence of escape codes and plain characters, and an ending quote, i.e. open ( escape | character )* close The "r" prefix doesn't change this; Python still parses the string as if it were an ordinary string, but stores it differently. in other words, both "\" and r"\" are parsed as an open quote, followed by an escaped quote, but no closing quote. </F>
- Previous message (by thread): is this a Python bug?
- Next message (by thread): is this a Python bug?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list