[Python-projects] W0212 False Positive

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Dec 19 20:21:10 CET 2006


On Tuesday 19 December à 12:48, Chris Mellon wrote:
> The checker for W0212(access to a protected member of a client class)
> , implemented in vist_getattr in classes.py, allows calls to your base
> class, but not your own class.
> 
> Example:
> 
> class Foo:
>     _attr = 1
>     def foo(self):
>         Foo._attr += 1 #False positive - raises W0212
> 
> class Bar(Foo):
>     def bar(self):
>         Foo._attr += 1 #No error

yep, that's a known bug already in the tracker and which will be
hopefully fixed in the next pylint release.

-- 
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



More information about the Python-Projects mailing list