[code-quality] false positive undefined-variable

Tom Ekberg tekberg at uw.edu
Thu Oct 8 17:45:07 CEST 2015


Here is my 9 line python program:

"""
Nothing to see here
"""

def is_priority(row):
    """
    Priority tests
    """
    print row

Here is the command line output, sans reports:

$ pylint --report=n foobarbaz.py 
No config file found, using default configuration
************* Module hud.monitors.foobarbaz
E:  9,10: Undefined variable 'row' (undefined-variable)

Why is row undefined if it is a function parameter? I realize I can turn it off with a configuration file, but this is such a simple case. I must be doing something wrong to get this error.

Because I'm sure you will ask, here is the pylint version detail:

$ pylint --version
No config file found, using default configuration
pylint 1.4.4, 
astroid 1.4.0, common 1.0.2
Python 2.7.3 (default, Feb 27 2014, 19:58:35) 
[GCC 4.6.3]

Running Ubuntu 12.04.4 LTS.

Tom Ekberg
Senior Computer Specialist, Lab Medicine
University of Washington Medical Center
1959 NE Pacific St, MS 357110
Seattle WA 98195
work: (206) 598-8544
email: tekberg at uw.edu




More information about the code-quality mailing list