Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should raise undefined-variable for self-referencing walrus operator expressions #5653

Closed
jacobtylerwalls opened this issue Jan 8, 2022 · 0 comments · Fixed by #6915
Closed
Labels
Assignment expression Related to the walrus operator / assignment expression C: undefined-variable Issues related to 'undefined-variable' check False Negative 🦋 No message is emitted but something is wrong with the code
Milestone

Comments

@jacobtylerwalls
Copy link
Member

Bug description

"""Should raise undefined-variable"""
if var := var:
    print(var)

Configuration

No response

Command used

pylint a.py

Pylint output

-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 5.00/10, +5.00)

Expected behavior

line 2: undefined-variable

Pylint version

pylint 2.13.0-dev0
astroid 2.9.2
Python 3.10.1 (v3.10.1:2cd268a3a9, Dec  6 2021, 14:28:59) [Clang 13.0.0 (clang-1300.0.29.3)]

OS / Environment

No response

Additional dependencies

No response

@jacobtylerwalls jacobtylerwalls added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jan 8, 2022
@DanielNoord DanielNoord added C: undefined-variable Issues related to 'undefined-variable' check False Negative 🦋 No message is emitted but something is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jan 9, 2022
@jacobtylerwalls jacobtylerwalls added the Assignment expression Related to the walrus operator / assignment expression label Mar 10, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.0 milestone Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assignment expression Related to the walrus operator / assignment expression C: undefined-variable Issues related to 'undefined-variable' check False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants