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 possibl
I consider the 'use strict'
in Perl more like a pragma as you hinted at: it changes the behavior of the compiler.
Perl language philosophy is different from python philosophy. As in, you are given more than enough rope to hang yourself repeatedly, in Perl.
Larry Wall is big into linguistics, so we have from Perl what is referred to as the TIMTOWTDI (say tim-toe-dee
) principle vs. Zen of python:
There should be one-- and preferably only one --obvious way to do it.
you could very easily use pylint and PyChecker to come up with your own flavor of use strict
for python (or something analogous to perl -cw *scriptname*
) but because of the different philosophies in the language design, you will not encounter this in practice widely.
Based on your comment to the first poster, you are familiar with python's import this
. There are a lot of things in there which illuminate why you do not see an equivalent of use strict
in Python. If you meditate on the koan found in the Zen of Python, you may find enlightenment for yourself. :)