r'\' - python parser bug?

Isaac To kkto at csis.hku.hk
Fri May 28 10:29:28 EDT 2004


>>>>> "Konstantin" == Konstantin Veretennicov <kveretennicov at yahoo.com> writes:

    Konstantin> @"\" // ok @"\"" // error, unterminated string literal

    Konstantin> For me, personally, trailing backslashes aren't as important
    Konstantin> as quotes.  Python wins again :)

hm...... Quotes in Python can only happen if it follows a \.  This is not
that useful I believe.  Of course, unless \ is really used as an escape
character in the string, i.e., regex.  Perhaps the "r" in r'\'' should be
read as "regex" rather than "raw"? =)

Regards,
Isaac.



More information about the Python-list mailing list