[Python-projects] Bug and testcase for pylint "Using variable before assignment" on one-liner with-statements

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Jan 13 19:36:14 CET 2009


Le Monday 22 December 2008 14:55:56 Mads Kiilerich, vous avez écrit :
> Hi,

hi,

> I'm not sure, but it seems like this is the place to report issues for
> the tracker at http://www.logilab.org/857

it's the right place

> Running pylint-0.14.0-1.fc9.noarch on this 2.5 snippet:
>
>     from __future__ import with_statement
>     with file('f') as f: print f.read()
>
> gives
>
>     E:  2: Using variable 'f' before assignment
>
> When the print statement is moved to its own line pylint correctly
> doesn't see an error

I've added a ticket for this bug: http://www.logilab.org/ticket/6954

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