python "syntax-checker"?

Alex Martelli aleaxit at
Mon Sep 11 09:56:32 CEST 2000

<s_gherman at> wrote in message news:8phlrn$4iu$1 at
> Is there any tool out there that would perform a "syntax-checking" on a
> Python source code?

Yes, and it's called "the Python compiler".  Whenever you compile a
Python source file, it is fully syntax-checked.

> Or, even more, to _simulate_ running and type-binding errors, etc (as
> compiler does for C, for instance)?

Not as far as I know, and it does not seem theoretically feasible, as
Python is too fluid & dynamic.  Some heuristic checking, as *lint* did
for C, is possible; there are indeed lint-like tools for Python.  See,
for example, this group of Tim Peters posts...:

or for a completed, working, simple thing, Ka-Ping Yee's pylint:

or the that comes with Aaron Watters' kwParser:

These, I believe, are all pretty old, from '97 or so; I don't
know how they would react to a Python program fully using today's
syntax &c.  These tools don't seem to attract much practical,
continuing interest, after the first blush thereof.

One more recent effort, by Scott Hassan and David Jeske, can
be found at:
with some explanation at:
This is from the end of last year, and it does focus on
type-inference, as you ask.  I'm not sure how much of a
practical tool it would prove, but, it may be worth checking
it up.

> I am not sure to what extent Python's dynamic type nature allows that,
> but I imagine there are some applications where one may not affors to
> half-run them just to find mistakes in the middle of his source code.

Of course there are, and in such cases one organizes one's development
process around the concept of *TESTING*.  There are excellent unit-test
frameworks for Python.  For the general concept, you may want to look
into Extreme Programming (XP), an approach whose inception was based
on Smalltalk but appears to me to be just as suited to Python, although
some useful XP tools are in very early stages for Python (a refactoring
browser, for example; there's a start to that at
if you're interested).  For a start on XP, among many other excellent
sites, do look into The Wiki, which talks
about many things but does end up mostly about XP and allied subjects,


More information about the Python-list mailing list