lint for python?
Roy Smith
roy at panix.com
Sat Apr 27 08:37:31 EDT 2002
I committed an interesting error just now. I've got a list, foo, and meant
to type:
foo.sort()
but left out the parens and ended up with:
foo.sort
in my program by accident. From python's point of view, it's not an error,
so no error message was produced. Even more interesting, both forms leave
foo as a list, with the same elements, so no exceptions got raised as I
continued to process the list further down in my program. My program
simply didn't do what wanted it to.
So, my question is, is there such a thing as lint for python? Something
like "foo.sort" could have generated a warning, "non-call of function", or
"rvalue with no assignment", or some such. It's certainly not something I
want the regular interpreter to do, but as a quality control tool, having
something that warns of questionable constructs is often useful.
More information about the Python-list
mailing list