[Python-projects] Can pylint be informed that a method is
calledby AClass.__init__ () ?
Meding, Olaf
Olaf.Meding at bruker-axs.com
Wed May 17 22:33:49 CEST 2006
Sylvain
> you can do that using the defining-attr-methods option, which default to __init__, __new__, setUp :).
But this would require that you name every method called each __init__() for every class. What would be much more usefull is to have an option to exempt all methods called by __init__().
Many thanks for considering.
Olaf
-----Original Message-----
From: python-projects-bounces at lists.logilab.org
[mailto:python-projects-bounces at lists.logilab.org]On Behalf Of Sylvain
Thénault
Sent: Wednesday, May 17, 2006 3:05 PM
To: Pierre_Rouleau at ImpathNetworks.com
Cc: python-projects at logilab.org
Subject: Re: [Python-projects] Can pylint be informed that a method is
calledby 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