-
-
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 expressionC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code
Milestone
Description
Bug description
from random import randint
asd2 = {
**({'param': x} if (x := randint(0, 1)) else {}),
}Configuration
No response
Command used
pylint a.pyPylint output
E0601: Using variable 'x' before assignment (used-before-assignment)Expected behavior
no error.
Pylint version
pylint 2.9.6
astroid 2.6.6
Python 3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]OS / Environment
Fedora 34
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
Assignment expressionRelated to the walrus operator / assignment expressionRelated to the walrus operator / assignment expressionC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code