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
$ pylint examples/tuple.py
************* Module tuple
examples/tuple.py:4:9: E0601: Using variable 'a' before assignment (used-before-assignment)
examples/tuple.py:4:13: E0601: Using variable 'b' before assignment (used-before-assignment)
examples/tuple.py:11:9: E0602: Undefined variable 'a' (undefined-variable)
examples/tuple.py:11:13: E0602: Undefined variable 'b' (undefined-variable)
Current behavior
Pylint returns error E0601 (used-before-assignment) when the left side of an assignment expression is used within the same tuple it was created in.
Pylint returns error E0602 (undefined-variable) when the left side of an assignment expression is used within the same tuple it was created in, in a lambda.
Expected behavior
Pylint shouldn't detect E0601 & E0602 on these expressions because they are valid python3.8 code.
In my opinion this is a good example of how to properly utilize the assignment operator and it should not result in an obvious false positive, regardless of what some people might think of the assignment operator in general.
Steps to reproduce
examples/tuple.py
Current behavior
Pylint returns error
E0601 (used-before-assignment)
when the left side of an assignment expression is used within the same tuple it was created in.Pylint returns error
E0602 (undefined-variable)
when the left side of an assignment expression is used within the same tuple it was created in, in a lambda.Expected behavior
Pylint shouldn't detect
E0601
&E0602
on these expressions because they are valid python3.8 code.pylint --version output
The text was updated successfully, but these errors were encountered: