Open nhdsd opened 3 weeks ago
test = (lambda : print(i) for i in range(10)) for call in test: call()
pylint -sn --disable=C0114 test.py
test.py:1:23: W0640: Cell variable i defined in loop (cell-var-from-loop)
No W0640, since the generator do generate functions as expected instead of generating print(9) for 10 times.
print(9)
pylint 3.3.1 astroid 3.3.5 Python 3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)]
Bug description
Command used
pylint -sn --disable=C0114 test.py
Pylint output
test.py:1:23: W0640: Cell variable i defined in loop (cell-var-from-loop)
Expected behavior
No W0640, since the generator do generate functions as expected instead of generating
print(9)
for 10 times.Pylint version