[Python-projects] E1101 and dynamically generated attributes
Maarten ter Huurne
maarten.ter.huurne at philips.com
Fri Jul 13 18:26:37 CEST 2007
syt at logilab.fr wrote on 2007-07-13 11:29:37 AM:
> On Thursday 12 July à 13:29, Maarten ter Huurne wrote:
> > class ClassWithDynamicAttributes(object):
> > # pylint: disable-msg=E1101
> >
> > # (rest of class definition)
> >
[stupid Lotus Notes did not preserve the indentation when sending HTML
e-mail]
> >
> > This would mean that any missing attributes on
ClassWithDynamicAttributes or
> > any of its subclasses do not lead to E1101 being issued.
> >
> > Does this approach make sense?
> > If so, I am willing to try and implement this; do you have any hints
where I
> > should start?
>
> that would be nice indeed. The problem is that currently messages
> disabling implementation is done according to source line numbers, not
> python objects, and I think it should be done that way to allow that
> kind of functionnality :(
It is already possible to silence warnings in a block scope, like this:
def f():
# pylint: disable-msg=E1234
# (rest of function definition)
How is this implemented? I had hoped it would add some kind of property to
the function object.
Maybe it does not work like that though and it only supresses the warning
if it is encountered while parsing the current block? That would explain
why sometimes the block-level suppression does not seem to work: some
warnings may be issued at a later time, when that block is no longer the
current block.
Bye,
Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20070713/6f6a526c/attachment.htm
More information about the Python-Projects
mailing list