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

Mads Kiilerich mads at kiilerich.com
Mon Dec 22 14:55:56 CET 2008


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

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

/Mads



More information about the Python-Projects mailing list