from
Adil Hasan <paradox2005 at gmail dot com>
to
Sylvain Thenault <syt at logilab dot fr>
cc
Python-Projects <python-projects at lists dot logilab dot org>
subject
Re: [Python-projects] pylint 0.7.0
date
Bonjour Sylvian,2005/06/03 17:12
Understood about the subclasses. Hmm I will have to have a little
think about this
for my case.
thanks for the input.
Amites,
adil
On 6/3/05, Sylvain Thénault <Sylvain.Thenault@logilab.fr> wrote:
> On Friday 03 June à 10:29, Adil Hasan wrote:
> > Bonjour Sylvain,
> > Ah thanks! Maybe it's not turned on by default. I'm running pylint on
> > a class based on the unittest class. If I define an instance variable
> > self.aVar='hello' and don't use the variable in another method
> > (specifically I define the variables in the setUp method) I don't get
> > a message by default. But, I suspect this is pilot error and I will
> > read the manual.
>
> hum, I think you didn't understood what I meant ;) What you call an
> instance variable is the same thing as what I call an instance
> attribute. An example:
>
> class A:
> def __init__(self):
> self.attr = 2
> self.unused = None
>
> def method(self, val):
> local_var = val
> return self.attr + val
>
> 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.
>
> cheers
> --
> Sylvain Thénault LOGILAB, Paris (France).
>
> http://www.logilab.com http://www.logilab.fr http://www.logilab.org
>
>
