[Python-projects] Can pylint be informed that a method is called by AClass.__init__ () ?

Pierre_Rouleau at ImpathNetworks.com Pierre_Rouleau at ImpathNetworks.com
Wed May 17 22:36:01 CEST 2006


Thanks!  I should really read this file a little bit more carefully! :)

Pierre




Sylvain Thénault <sylvain.thenault at logilab.fr> on 05/17/2006 04:05:15 PM

Please respond to Sylvain Thénault <sylvain.thenault at logilab.fr>

To:   Pierre Rouleau/impath at impath
cc:   python-projects at logilab.org

Subject:  Re: [Python-projects] Can pylint be informed that a method is called
      by AClass.__init__ () ?



On Wednesday 17 May à 14:39, Pierre_Rouleau at ImpathNetworks.com wrote:
> Bonjour à tous,

Bonjour Pierre,

> Pylint (the latest, and previus) generates a W0201 warning when a instance
> attribute is created outside of the class __init__() method even if that
method
> is called from __init__().
>
> I do not want to disable that warning in that particular case.
>
> Is there a way I can tell Pylint that method xxxx() is called from __init__()
so
> it should not complain that xxxx() creates instance attributes?  There are
cases
> where it is nice to have one or several methods that create instance
attributes
> to clarify the source.

you can do that using the defining-attr-methods option, which default to
__init__, __new__, setUp :).

--
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science

_______________________________________________
Python-Projects mailing list
Python-Projects at lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects









More information about the Python-Projects mailing list