Unrecognized escape sequences in string literals

Aahz aahz at pythoncraft.com
Fri Aug 14 16:07:31 CEST 2009

In article <6e13754c-1fa6-4d1b-8861-146bffec8656 at h30g2000vbr.googlegroups.com>,
Douglas Alan  <darkwater42 at gmail.com> wrote:
>My friend begs to differ with the above. It would be much better for
>debugging if Python generated a parsing error for unrecognized escape
>sequences, rather than leaving them unchanged. g++ outputs a warning
>for such escape sequences, for instance. This is what I would consider
>to be the correct behavior. (Actually, I think it should just generate
>a fatal parsing error, but a warning is okay too.)

Well, then, the usual response applies: create a patch, discuss it on
python-ideas, and see what happens.

(That is, nobody has previously complained so vociferously IIRC, and
adding a warning is certainly within the bounds of what's theoretically
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes

More information about the Python-list mailing list