Unrecognized escape sequences in string literals

Carl Banks pavlovevidence at gmail.com
Mon Aug 10 19:29:27 CEST 2009


On Aug 10, 4:41 am, MRAB <pyt... at mrabarnett.plus.com> wrote:
> Steven D'Aprano wrote:
> > On Sun, 09 Aug 2009 17:56:55 -0700, Douglas Alan wrote:
>
> [snip]
> >> My point of view is that
> >> every language has *some* warts; Python just has a bit fewer than most.
> >> It would have been nice, I should think, if this wart had been "fixed"
> >> in Python 3, as I do consider it to be a minor wart.
>
> > And if anyone had cared enough to raise it a couple of years back, it
> > possibly might have been.
>
> My preference would've been that a backslash followed by A-Z, a-z, or
> 0-9 is special, but a backslash followed by any other character is just
> the character, except for backslash followed by a newline, which
> suppresses the newline.

That would be reasonable; it'd match the behavior of regexps.


Carl Banks




More information about the Python-list mailing list