How can I catch misnamed variables?

Christian Heimes lists at cheimes.de
Fri Feb 10 18:21:11 EST 2012


Am 10.02.2012 22:06, schrieb John Gordon:
> Is there an automated way to catch errors like these?  I'm using the
> compileall module to build my program and it does catch some errors
> such as incorrect indentation, but not errors like the above.

Write unit tests and use coverage to aim for 100% code and branch coverage.

If you want to write high quality code and avoid problems like misnamed
variables then you have to write unit tests and functional tests for
your program. I'm well aware that it's hard and requires time. But in
the long run it will *save* lots of time.




More information about the Python-list mailing list