Jon writes about dynamic languages and static checking (which rightly should be optional IMHO)...
Are there reasons why Python can't, or shouldn't, support something like "use strict"?
The answer in this case is pychecker. I don't know how pychecker's features line up with perl's strict.
Running Jon's example through pychecker like this... pychecker loose.py
results in the following:
File "loose.py", line 2 print '[' + aNyme + ']'; NameError: name 'aNyme' is not defined
pychecker does not catch the contributed example to Jon's article. For example running
pychecker other-example.py
where the contents are...
sysmsg = 'foo&bar'
sysmgs = sysmsg.replace('&',' ')
print sysmsg
This results in no warnings, although I would expect at least a warning that the variable sysmsgs
is unused.
Ted mentions Starkiller, which hopefully will be given ongoing support in the Python community.
No comments:
Post a Comment