How to detect typos in Python programs

Manish Jethani manish.j at gmx.net
Fri Jul 25 09:56:14 EDT 2003


Hi all,

Is there a way to detect typos in a Python program, before
actually having to run it.  Let's say I have a function like this:

  def server_closed_connection():
    session.abost()

Here, abort() is actually misspelt.  The only time my program
follows this path is when the server disconnects from its
end--and that's like once in 100 sessions.  So sometimes I
release the program, people start using it, and then someone
reports this typo after 4-5 days of the release (though it's
trivial to fix manually at the user's end, or I can give a patch).

How can we detect these kinds of errors at development time?
It's not practical for me to have a test script that can make
the program go through all (most) the possible code paths.

-Manish

-- 
Manish Jethani (manish.j at gmx.net)
phone (work) +91-80-51073488






More information about the Python-list mailing list