[Python-Dev] more pychecker warnings from python-current (original) (raw)

Neal Norwitz neal@metaslash.com
Wed, 17 Oct 2001 22:53:48 -0400


Tim Peters wrote:

>> doctest.py:528: Parameter (prefix) not used >> docstring says prefix is used, but it isn't > Tim? No, the docstring says prefix is ignored: def isprivate(prefix, base): """prefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this ^^^^^^^^^^^^^^^^^ protocol may make use of it). ...

Oops, sorry about that, I saw all the example usages in the docstring and thought it was used. I didn't pay close enough attention.

I wouldn't be averse to adding, e.g.,

if 0: prefix # make prefix appear used to checking tools but sooner or later checking tools will complain about that too.

I wouldn't worry about it. I think I will eventually create a suppressions dictionary for the std library. So any warning that checker might normally output will not produce a warning, when it has been determined the code is correct.

The capability exists to do this today. However, my concern is putting in a suppression and later that suppression masks a real error.

In general, we (collectively) can define best practices for both code and checking tools, at least pychecker.

Neal