You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TEST_A= [
(lambda: n)
forninrange(3)
]
TEST_B= [
(lambda: [nfor_inrange(3)])
forninrange(3)
]
print(TEST_A[1]()) # User probably intended for this to be 1, actually 2print(TEST_B[1]()) # User probably intended for this to be [1, 1, 1], actually [2, 2, 2]
Run pylint a.py
Current behavior
There is a lint failure: a.py:2:13: W0640: Cell variable n defined in loop (cell-var-from-loop)
Tere is no such failure for TEST_B.
Expected behavior
Lint failures for both TEST_A and TEST_B.
pylint --version output
pylint 2.3.1
astroid 2.2.5
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)]
The text was updated successfully, but these errors were encountered:
Steps to reproduce
a.py
containing:pylint a.py
Current behavior
There is a lint failure:
a.py:2:13: W0640: Cell variable n defined in loop (cell-var-from-loop)
Tere is no such failure for
TEST_B
.Expected behavior
Lint failures for both
TEST_A
andTEST_B
.pylint --version output
The text was updated successfully, but these errors were encountered: