is this a Python bug?

Steve Holden sholden at bellatlantic.net
Wed Feb 16 16:53:03 EST 2000


Fredrik Lundh wrote:
> 
> Brian Langenberger <brian at brian.cbs.umn.edu> wrote:
> > [snip]
> > >>> r'\\\'
> >   File "<stdin>", line 1
> >     r'\\\'
> >          ^
> > SyntaxError: invalid token
> > >>>
> >[snip]
> you missed something in the docs:
> http://www.python.org/doc/current/ref/strings.html
> 
>     "When an 'r' or 'R' prefix is present, backslashes
>     are still used to quote the following character,
>     but all backslashes are left in the string. /.../
>     Specifically, a raw string cannot end in a single
>     backslash (since the backslash would escape the
>     following quote character)."
> 
> </F>

I actually SAW this in the docs, thought about it for a while,
and then thought "I'll wait until someone translates that".

What on Earth does "backslashes are still used to quote the
folowing character, but all backslashes are left in the string"
mean?  I am sure it means something, but I can't tell what.

no-longer-knowing-whether-\\-means-\\\-or-\\\\-ly y'rs  - Steve
--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list