[Python-ideas] raw strings

Georg Brandl g.brandl at gmx.net
Mon Oct 1 21:05:31 CEST 2007


Clark Maurer schrieb:

[Others have commented about the no-raw-strings-ending-in-backslash thing.]

> f=r'Here''s another mistake'      # This doesn't do what you would think. 
>                                   # You get 'Heres another mistake'

This is no mistake, and it won't change. The first single quote ends one string
literal, and the second starts another, and they are concatenated in the
parsing stage.

> f=r'''Here's another mistake'''   # This works but being able to use raw
>                                   # strings for this would be nice.

Actually, this is a raw string too.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.




More information about the Python-ideas mailing list