How to perform syntax check in Python

Meera meera_bavadekar at hp.com
Thu Nov 11 03:01:40 CET 1999


Hello everybody,

I am looking for  a utility to perform syntax validation in python.
Consider following code -

try:
  a = 3
  print a
  #Do some more processing
except:
  print b

The fact that variable b is not defined is known only when we get
exception.
We will get 'NameError exception' _not_  the actual exception we are
expecting.

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.


Thanks,
Meera





More information about the Python-list mailing list