How to perform syntax check in Python
fredrik at pythonware.com
Thu Nov 11 09:17:15 CET 1999
Meera <meera_bavadekar at hp.com> wrote:
> I am looking for a utility to perform syntax validation in python.
> Consider following code -
> a = 3
> print a
> #Do some more processing
> print b
> The fact that variable b is not defined is known only when we get
> We will get 'NameError exception' _not_ the actual exception we are
> When we have multi-developer and multi-platform environment - such
> feature is crucial. This is one area which I would like python to improve
> over conventional language.
having been there and done that, I'd say a good testing
harness is a better way to address that -- helps you find
both code glitches and real bugs (!).
but if you really prefer linting, check out chordate's pylint
utility, available from:
<!-- (the eff-bot guide to) the standard python library:
(news: just posted an errata for the 'first printing') -->
More information about the Python-list