Message348357
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. |
|
| Date |
User |
Action |
Args |
| 2019-07-23 23:40:53 | asmeurer | set | recipients:
+ asmeurer, rhettinger, terry.reedy, mark.dickinson, ncoghlan, r.david.murray, serhiy.storchaka, abarry, Eric Wieser |
| 2019-07-23 23:40:53 | asmeurer | set | messageid: <[email protected]> |
| 2019-07-23 23:40:53 | asmeurer | link | issue32912 messages |
| 2019-07-23 23:40:53 | asmeurer | create | |
|