There exist static analysis tools for Python, but compile time checks tend to be diametrically opposed to the run-time binding philosophy that Python embraces. It's possible to wrap the standard Python interpreter with a static analysis tool to enforce some "use strict"-like constraints, but we don't see any widespread adoption of such a thing.
Is there something about Python that makes "use strict" behavior unnecessary or especially undesirable?
Alternatively, is the "use strict" behavior unnecessary in Perl, despite its widespread adoption?
Note: By "necessary" I mean "practically necessary", not strictly necessary. Obviously you can write Perl without "use strict," but (from what I've seen) most Perl programmers do use it.
Note: The Python interpreter-wrapper need not require "use strict"-like constraints -- you could use a pseudo-pragma similar to "use strict" that would be ignored by the normal interpreter. I'm not talking about adding a language-level feature.
Update: Explaining what "use strict" does in Perl per comments. (Link to official docs is in the first paragraph.)
The "use strict" directive has three distinct components, only two of which are really interesting:
use strict vars: Statically checks lexically scoped variable usage in your program. (Keep in mind that, in Python, there is basically only
localscope). Many Python linters check for this sort of thing. Since it's the only static analysis that they can do, the linters assume you use straightforward lexical scoping and warn you about things that appear wrong in that sense until you tell them to shut up; i.e.
FOO = 12 foo += 3
If you're not doing anything fancy with your namespaces this can be useful to check for typos.
use strict refs: Prevents symbolic namespace dereferencing. Python's closest analog is using
globals()to do symbolic binding and identifier lookup.
use strict subs: No real analog in Python.