[Python-Dev] Emit SyntaxWarning on unrecognized backslash escapes?

Stephen J. Turnbull stephen at xemacs.org
Tue Feb 24 16:05:29 CET 2015


Chris Angelico writes:

 > I don't mind how long the deprecation period is, as long as there can
 > be an option to Python that makes a noisy warning.

If that's OK with you and for the use case you explicitly described,
though, a .bat file that runs a linter first might be the better
option since (a) you don't have to wait and (b) you can put any
bugaboo you like in there and (c) it can warn about syntacticly
correct strings that "just fail" and may be hard to find.

I think the Zen is right on, here:

    Now is better than never.
    Although never is often better than *right* now.

I don't have a good sense for which it is, though, partly because (a)
I don't program on Windows, but more importantly, (b) many of the
dangerous strings actually used won't generate warnings or errors ever.


More information about the Python-Dev mailing list