How can I catch misnamed variables?
Arnaud Delobelle
arnodel at gmail.com
Fri Feb 10 16:17:02 EST 2012
On 10 February 2012 21:06, John Gordon <gordon at panix.com> wrote:
> Recently I was been bitten by some stupid errors in my code, and I'm
> wondering if there's a simple way to catch them.
>
> One error was of the form:
>
> my_object.some_function()
>
> .. when I hadn't declared an object named "my_object".
>
> The other error was similar:
>
> x = my_module.CONSTANT
>
> .. when I hadn't imported my_module.
>
> Of course both of these errors were deep inside a long-running function
> call, so it took a while for them to crop up.
>
> 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.
There's pychecker and pylint
--
Arnaud
More information about the Python-list
mailing list