[Python-projects] Possible error within PyLint

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Feb 7 13:25:53 CET 2008


On Thu, Feb 07, 2008 at 11:09:44AM +0100, Helmut Namyslo wrote:
> Dear Logilab Team,
>  
> First of all I want you to thank for the great tool PyLint. It really halps us
> to keep
> our Python code clean.  

thanks :)

> Maybe I found a little error within PyLint. Look at the
> following code sequence:
>  
> 1: x = 10
> 2: for x in range(5):
> 3:     print x
> 4:   
> 5: if x > 0:
> 6:     print '#' * x
>  
> PyLint produces the following messages:
>  
> Message File Name       Line    Position
> [W] Using possibly undefined loop variable 'x' D:\Vision_QA\Other\test.py     
> 5      
> [W] Using possibly undefined loop variable 'x' D:\Vision_QA\Other\test.py     
> 6      
>  
> As far as I understand this code, there is no risk that variable x might be
> undefined at lines 5 and 6.

I've fixed this bug in logilab.astng repository. Thanks for the report.

BTW, the right place to discuss about pylint and post bugs is the
python-projects at logilab.org mailing-list, which I'm ccing.
-- 
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