[issue32912] Raise non-silent warning for invalid escape sequences

Raymond Hettinger report at bugs.python.org
Tue Jul 23 15:42:18 EDT 2019


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I'm starting to see this error even for plain text strings in existing code:

>>> dunder_methods = '''

d[k]          d.__getitem__(k) -> value 
                   \--> d.__missing__(k) -> value
                    \-----------> raise KeyError(k)
d[k] = v      d.__setitem__(k, v) -> None
del d[k]      d.__delitem__(k) -> None

'''

SyntaxError: invalid escape sequence \-


These not easily suppressed messages are really annoying.  We don't have to inflict this on our users.  IMO, this is the least user friendly change to Python 3.8 and as far as I can tell, it is entirely unnecessary (we've lived without it for 28+ years).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32912>
_______________________________________


More information about the Python-bugs-list mailing list