typo.py - Warn of typographical errors in Python scripts
Alan Klietz
alank at algintech.NOSPAM.com
Mon Jul 9 12:25:38 EDT 2001
One of the most common annoyances with using Python is that it does
not report typographical errors in variable names at compile time.
For example,
def compute_area(width, height):
area = width * hieght # oops
Another example is a typo in an attribute for a class,
class Square:
def __init__(self, width, height):
self.width = width
self.hieght = height # oops
def compute_area(self):
return self.width * self.height
typo.py will catch these errors and report them:
hieght might be used before set at line 2
self.height might be undefined at line 7
You can download typo.py from http://utools.com/typo.htm
Alan Klietz
Algin Technology
alank at algintech.NOSPAM.com
More information about the Python-list
mailing list