pylint #18862 E0601 false positive with lambda functions [resolved]
James Lingard reported...
The following program:
def f(): g = lambda: x x = 1 print g()
generates the following unnecessary error:
E0601: 2:f.<lambda>: Using variable 'x' before assignment
Note that the following program doesn't generate the error:
def f(): def g(): return x x = 1 print g()
I think it would make sense for this warning to treat lambda expressions the same as function definitions.
|closed by||<not specified>|