[New-bugs-announce] [issue17777] Unrecognized string literal escape sequences give SyntaxErrors
report at bugs.python.org
Wed Apr 17 17:37:35 CEST 2013
New submission from Reynir Reynisson:
Strings like "\u" trigger a SyntaxError. According to the language reference "all unrecognized escape sequences are left in the string unchanged". The string "\u" clearly doesn't match any of the escape sequences (in particular \uxxxx).
This may be intentional, but it is not clear from the language reference that this is the case. If it is intentional it should probably be stated more explicit in the language reference.
I think this may be confusing for new users since the syntax errors may lead them to believe the interpreter will give syntax error for all unrecognized escape sequences.
assignee: docs at python
components: Documentation, Unicode
nosy: docs at python, ezio.melotti, reynir
title: Unrecognized string literal escape sequences give SyntaxErrors
versions: Python 3.3
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce