Syntax of string literals

Fredrik Lundh fredrik at effbot.org
Mon Nov 13 17:49:41 EST 2000


Marcin 'Qrczak' Kowalczyk wrote:
> Why aren't unrecognized escape sequences simply illegal?
> They would be yet more easily recognized as broken.
>
> They would still be legal in raw strings.

raw strings are a relatively late addition to the language.

before they were added, people used ordinary strings
for regular expressions, and the "copy as is" rule sure
helped keeping things readable.

it's too late to change anyway... (heck, even the "\x now
requires exactly two digits" change broke existing code)

</F>





More information about the Python-list mailing list