Aaron Meurer <asmeu...@gmail.com> added the comment:

Well paradoxically, the bugs that this prevents are the ones it doesn't warn 
about. If someone writes '\tan(x)' thinking it is a string representing a LaTeX 
formula for the tangent of x, they won't realize that they actually created a 
string with a tab plus "an(x)". So actually I would argue that the end goal 
*is* to make people aware of which escape characters exist, or at the very 
least, always make strings raw if there's even the remotest chance they will 
contain a backslash character. 

Is it the best way to go about this? I don't know. The whole thing sort of 
makes me think raw strings should have been the default, but it's obviously too 
late to change that. 

I personally don't feel strongly about the warnings being enabled by default or 
not. My big gripe is that if you actually want the warnings they are difficult 
to get in a reproducible way. I'm actually surprised they are so annoying for 
you. Once a py file is compiled into a pyc file the warnings completely 
disappear, even if you want them!

The fact that you can't use a real escape sequence in a raw string is annoying 
but not the end of the world given that it's trivial to concatenate strings.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32912>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to