-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pylint does not recognize potential undefined variables #85
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
Labels
C: undefined-variable
Issues related to 'undefined-variable' check
Control flow
Requires control flow understanding
Enhancement ✨
Improvement to a component
False Negative 🦋
No message is emitted but something is wrong with the code
Hacktoberfest
Help wanted 🙏
Outside help would be appreciated, good for new contributors
High priority
Issue with more than 10 reactions
Milestone
Comments
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): see also issue #12 |
this has been open 6 years. Is it on the roadmap? thanks |
Here's the test case actualized for python3: try:
# throw exception here to make res undefined
res = 1 / 0
res = 42
finally:
print(res) @dpinol this require control-flow which pylint does not have. Apparently no one worked on it yet, I'd be glad to review a merge request that fix this. |
jacobtylerwalls
added a commit
to jacobtylerwalls/pylint
that referenced
this issue
Nov 24, 2021
…e try statements could have failed
jacobtylerwalls
added a commit
to jacobtylerwalls/pylint
that referenced
this issue
Nov 24, 2021
…e try statements could have failed
jacobtylerwalls
added a commit
to jacobtylerwalls/pylint
that referenced
this issue
Nov 25, 2021
…e try statements could have failed
jacobtylerwalls
added a commit
to jacobtylerwalls/pylint
that referenced
this issue
Dec 11, 2021
…final or except blocks where try statements could have failed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C: undefined-variable
Issues related to 'undefined-variable' check
Control flow
Requires control flow understanding
Enhancement ✨
Improvement to a component
False Negative 🦋
No message is emitted but something is wrong with the code
Hacktoberfest
Help wanted 🙏
Outside help would be appreciated, good for new contributors
High priority
Issue with more than 10 reactions
Originally reported by: Mirko Dziadzka (BitBucket: mirkodziadzka, GitHub: @MirkoDziadzka?)
The following code should generate a warning, that the variable res may be undefined in the finally clause
The text was updated successfully, but these errors were encountered: