[issue34850] Emit a syntax warning for "is" with a literal

Gregory P. Smith report at bugs.python.org
Sun Sep 30 21:39:36 EDT 2018


Gregory P. Smith <greg at krypto.org> added the comment:

If we were to ship a "chaos" mode in the CPython interpreter itself, I assume you envision an interpreter flag and/or env var?  If it required someone compiling the interpreter a special way I don't think it would be widely adopted within continuous integration testing systems.

I was actually pondering doing a "chaos" mode of sorts at work because I have the power to cause everyone's tests to be run that way mode by default.  (I'd basically just disable interning and str/int singletons)  But while it's a nice idea, it's low on my work priorities.  While we had thousands of is literal comparisons that we're about to fix en-masse, they are only a tiny fraction of all literal comparisons in our codebase.  And pylint is now more widely used which should help prevent new ones.

----------

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


More information about the Python-bugs-list mailing list