[Python-ideas] raw strings

Steven Bethard steven.bethard at gmail.com
Mon Oct 1 22:23:48 CEST 2007

On 10/1/07, Clark Maurer <cmaurer at slickedit.com> wrote:
> The current implementation doesn't allow for a trailing backslash in the
> string.

On 10/1/07, Guido van Rossum <guido at python.org> wrote:
> It's more the philosophical distinction -- are raw
> strings meant primarily to hold regexes or Windows pathnames? These
> two use cases have opposite requirements for trailing backslash
> treatment. I know the original use case that caused them to be added
> to the language is regexes, and that's still the only one I use on a
> regular basis.

FWLIW, I'm in exactly the opposite boat.  I use very few regular
expressions that include quotes, and when I do run into one I always
use the appropriate quote type so that I don't need to escape the
quotes. On the other hand, I write quite a few Windows paths, and
probably make the final-backslash mistake once a week.  (It's quickly
flagged and fixed, but I still make it.)

I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy

More information about the Python-ideas mailing list