[Python-Dev] PEP 292, Simpler String Substitutions

Tim Peters tim.one@comcast.net
Fri, 21 Jun 2002 19:01:25 -0400


[Paul Prescod]
> I like this idea but note that \( does have a current meaning:
>
> >>> "\("
> '\\('
> >>> "\(" =="\\("
> 1
>
> I think this is weird but it is inherited from C...

C89 doesn't define the effect.  C99 specifically forbids this treatment, and
requires a diagnostic if \( appears.  Guido did this originally to make it
easier to write Emacsish regexps; the later raw strings were a better
solution to that problem, although 99.7% of Python newbies seem to believe
that raw strings are an idiot's attempt to make it easier to embed Windows
file path literals (newbies -- gotta love 'em <wink>).