-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Assignment expressionRelated to the walrus operator / assignment expressionRelated to the walrus operator / assignment expressionFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codepython 3.8
Milestone
Description
Steps to reproduce
# ~/tmp λ cat test4.py
def i(am: str = (the := "walrus")) -> str:
return "goo goo g'joob"
print(the)Current behavior
~/tmp λ pylint -E test4.py
************* Module test4
test4.py:5:6: E0602: Undefined variable 'the' (undefined-variable)
Expected behavior
pylint recognises that the is defined. (Or alternatively, pylint yells at me for doing this weird thing in the first place ;-) )
pylint --version output
~/tmp λ pylint --version
pylint 2.5.3
astroid 2.4.2
Python 3.8.3 (default, May 27 2020, 20:54:22)
[Clang 11.0.3 (clang-1103.0.32.59)]
Pretty minor, especially given that assignment expressions aren't a priority for pylint (#3275 (comment)).
Metadata
Metadata
Assignees
Labels
Assignment expressionRelated to the walrus operator / assignment expressionRelated to the walrus operator / assignment expressionFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codepython 3.8