Open cdyson37 opened 6 years ago
While I admit that this looks like a bug in pylint, I wonder though why the s
is not initialised in the body of the function, which can then return it?
This is very much reduced down for a real world (non-insane, honest) example :)
Gotcha, I was just curious. :)
The original code iterates up and down a tree visiting things and accumulating what it sees. I could tell you more but I'd have to kill you ;)
Does https://github.com/PyCQA/pylint/pull/2276 fixed this issue ?
@SamyCookie Doesn't seem to be.
another (fictive) example that just regressed since 2.10 version, I also got a spurious cell-var-from-loop
warning:
for n in range(10):
plus_n = lambda i: i + n
foo = plus_n(42) + plus_n(17)
print(foo)
I think this is a spurious warning. In the below,
s
is not defined in any loop.Steps to reproduce
Current behavior
Triggers cell-var-from-loop
Expected behavior
No warning
pylint --version output