lint for Python?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Mon Oct 6 20:44:10 CEST 2008


Pat a écrit :
> I've been searching for a good multi-module lint checker for Python and 
> I haven't found one yet.
> 
> Pylint does a decent job at checking for errors only within a single 
> module.
> 
> Here's one of my problems.  I have two modules.
> 
> In module one, I have a function:
> 
> def foo( host, userid, password ):
>     pass
> 
> In module two, I call that function:
> 
> foo( userid, password)
> 
> lint doesn't find that error

Nope, but even the most simple manual test should find it pretty quick.

> and it won't be caught until it's called 
> while the program is running.  I don't want that error found at 3AM.

Don't you ever test your code ???

> I've never used a language that didn't catch that type of error.

It does. Just try to run your code, and you'll have a nice traceback. 
Unless of course 'foo' is rebound in module two to another callable 
expecting only two parameters...

>  I'm 
> quite surprised that Python is being used by a number of major 
> companies.

Perhaps do they rely more on testing and less on the compiler ? FWIW, 
I've seen my share of bugs in declarativly statically typed languages, 
and most of them were way nastier (and way less obvious) than the above one.

>  How you catch these types of errors?

Just like any other type of errors : testing, testing, and then add some 
more tests.




More information about the Python-list mailing list