[code-quality] false positive undefined-variable

Andrew Farrell amfarrell at mit.edu
Thu Oct 8 21:38:12 CEST 2015


The first time I tried reproducing this, I got

  ************* Module testtom
  C:  1, 0: Missing module docstring (missing-docstring)
  E:  5,10: Undefined variable 'row' (undefined-variable)
  W:  1,16: Unused argument 'now' (unused-argument)

After fixing my typo, I only see the error
  C:  1, 0: Missing module docstring (missing-docstring)

so perhaps you've got a typo

On Thu, Oct 8, 2015 at 10:45 AM, Tom Ekberg <tekberg at uw.edu> wrote:

> 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
>
>
> _______________________________________________
> code-quality mailing list
> code-quality at python.org
> https://mail.python.org/mailman/listinfo/code-quality
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20151008/2dec2cb4/attachment.html>


More information about the code-quality mailing list