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

False-positive "used-before-assignment" on ternary variable assignment (python3.8) #3763

Closed
Mastermind-U opened this issue Aug 4, 2020 · 1 comment · Fixed by #4253
Closed
Labels
Enhancement ✨ Improvement to a component

Comments

@Mastermind-U
Copy link

Steps to reproduce

  1. Python3.8 works fine:
>>> foo if (foo := 3 - 2) > 0 else 0
1
  1. Run pylint:
pylint somefile.py

Current behavior

Got output E0601: Using variable 'foo' before assignment (used-before-assignment)

pylint --version output

pylint 2.5.3
astroid 2.4.2
Python 3.8.3 (default, May 17 2020, 18:15:42) 
[GCC 10.1.0]
@Mastermind-U Mastermind-U changed the title False-positive "no-member" on thernary variable assignment False-positive "no-member" on thernary variable assignment (python3.8) Aug 4, 2020
@Mastermind-U Mastermind-U changed the title False-positive "no-member" on thernary variable assignment (python3.8) False-positive "no-member" on ternary variable assignment (python3.8) Aug 4, 2020
@Mastermind-U Mastermind-U changed the title False-positive "no-member" on ternary variable assignment (python3.8) False-positive "used-before-assignment" on ternary variable assignment (python3.8) Aug 5, 2020
@AWhetter AWhetter added the Enhancement ✨ Improvement to a component label Sep 7, 2020
@AWhetter
Copy link
Contributor

AWhetter commented Sep 7, 2020

I can reproduce this on master. As far as I'm aware, we don't have very good support for walrus operators yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants