[Python-apps-team] Bug#700565: pyflakes: incorrectly tracks scope of vars defined in genexps

Jakub Wilk jwilk at debian.org
Thu Feb 14 11:29:30 UTC 2013


Package: pyflakes
Version: 0.6.1-1~exp1
Severity: normal

Variables defined in generator expressions (unlike those defined in list 
comprehensions) don't leak to the surrounding scope. For example, for 
the attached code pyflakes should have emitted:

test.py:2: undefined name 'x'

Instead it incorrectly emits:

test.py:3: list comprehension redefines 'x' from line 1


-- System Information:
Debian Release: 7.0
   APT prefers unstable
   APT policy: (990, 'unstable'), (500, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.7-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pyflakes depends on:
ii  python  2.7.3-4

-- 
Jakub Wilk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 34 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20130214/7f092962/attachment.py>


More information about the Python-apps-team mailing list