what is wrong with that r"\"

Duncan Booth duncan.booth at invalid.invalid
Wed Jul 4 07:47:33 EDT 2007


Nick Craig-Wood <nick at craig-wood.com> wrote:

> Does anyone know the justification for a)?  Maybe we should remove it
> in py3k?
> 

I think at least part of the justification is that it keeps the grammar 
simple. The tokenising happens identically irrespective of any modifiers. 
The r modifier doesn't actually change the syntax of the string at all, 
just the interpretation of the token.

If you changed this then the grammar would become slightly more complex.



More information about the Python-list mailing list