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>|
- logilab-astng #18773 inference bug on class members
- logilab-astng #4601 Exception: NotFoundError: ItemDataRole
- pylint #4288 message [en|dis]abling refactoring
- pylint #3203 disabling W0702 (no exception's type specified) works in a strange way
- logilab-astng #9515 strange message for non-class "Class baz has no egg member"