] > Re: [Python-projects] pylint 0.7.0 (Logilab.org)

Email Re: [Python-projects] pylint 0.7.0

from
subject
Re: [Python-projects] pylint 0.7.0
date
2005/06/05 09:24
On Fri, Jun 03, 2005 at 11:58:30AM +0200, Sylvain Thénault wrote:
 
> In this exemple, you'll have a message for "local_var is defined but not
> used", but not for "self.unused is defined but not used".
> PyLint doesn't check for unused instance attributes mainly because, as I
> said in my previous post, we don't know if there isn't a subclass using
> some ancestor attribute. I agree this is arguable and that it may be an
> interesting future warning message.

It is not only a problem with subclasses. You also need to check that
noone tries to read or write the attribute on an existing instance of
the class, which is not possible, since you can hardly know the class of
an instance only by looking at the code using that instance, and you
can't know for sure that you have checked the whole body of code using
that class. 

-- 
Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org