[Python-projects] pylint and function attributes

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Apr 2 09:22:34 CEST 2009


Le Tuesday 31 March 2009 15:33:39 Jürgen Hermann, vous avez écrit :
> Hi, 

Hi Jürgen,

> found another problem with pylint 0.18.0 and no open ticket for it -- 
> basically, pylint doesn't understand function attributes at all. In 0.14,
> you always got the warning (which I ignored so far), now you also get an
> error (see below).
>
> > cat test.py
>
> "test"
> def test():
>     "test"
>     print test.bar
> test.bar = 1
> test()
>
> > python test.py
>
> 1
>
> > pylint -rn test.py
>
> ************* Module test
> E:  4:test: Class 'test' has no 'bar' member
> W:  5: Unused variable 'bar'

http://www.logilab.org/ticket/8847

thank you for the report!
-- 
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