Is this a bug?

Tim Peters tim.one at home.com
Sun May 13 15:39:55 EDT 2001


[Alex Martelli, in reply to Costas Menico]
> ...
> I do hope this debate resolves your personal issue that you expressed
> as "I just don't understand why the parser can't be smart enough about
> this".  The Python parser is "smart enough" about rawstrings to focus
> anomalies into ONE, easily documented, easily understood and tested-
> for issue -- zero is not achievable, and that one was craftily chosen.
> Rawstrings are optimized for use as regular-expression literals, where
> there is never any need for them to end with an odd number of
> backslashes.

Something often overlooked here is the tool issue:  virtually every
programmer's editor in existence "knows" that double and single quotes
delimit strings, and that within a string a backslash escapes the character
immediately following.  The rule for r-strings gives such tools no trouble at
all:  they may not have deep knowledge of what exactly the string consists
of, but they know for certain where it begins and ends just by applying "the
usual" string escape rules.  That was by design too, of course.

Maybe we should introduce d-strings for DOS pathnames <wink>.

every-app-is-the-most-important-app-ly y'rs  - tim





More information about the Python-list mailing list