In article <[EMAIL PROTECTED]>, Matthew Warren wrote: > I would expect this to work, > > rawstring=r'some things\new things\some other things\' > > But it fails as the last backslash escapes the single quote.
String constants in Python are weird - raw strings doubly so. In a raw string, backslashes are not special - unless followed by a quote character, when they simultaneously escape the quote and also insert a literal backslash. I presume there was originally some reason for this bizarre behaviour - it'd be interesting to know what it is/was, if anyone knows? -- http://mail.python.org/mailman/listinfo/python-list