Unrecognized escape sequences in string literals
duncan.booth at invalid.invalid
Mon Aug 10 11:34:38 CEST 2009
Douglas Alan <darkwater42 at gmail.com> wrote:
> "\xba" isn't an escape sequence in any other language that I've used,
> which is one reason I made this error... Oh, wait a minute -- it *is*
> special character, "\xb" is synonymous with "xb".
probably many others.
Perl. Python will throw ValueError if you try to use "\xb" in a string,
> The fact that every language seems to treat these things similarly but
> differently, is yet another reason why they should just be treated
> utterly consistently by all of the languages: I.e., escape sequences
> that don't have a special meaning should be an error!
It would be nice if these things were treated consistently, but they aren't
and it seems unlikely to change.
Duncan Booth http://kupuguy.blogspot.com
More information about the Python-list