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

Possibly unbounded variable not found #8783

Closed
alonme opened this issue Jun 18, 2023 · 1 comment
Closed

Possibly unbounded variable not found #8783

alonme opened this issue Jun 18, 2023 · 1 comment
Labels
C: used-before-assignment Issues related to 'used-before-assignment' check Duplicate 🐫 Duplicate of an already existing issue

Comments

@alonme
Copy link

alonme commented Jun 18, 2023

Bug description

text = input()

if text == "testing":
    unbounded = True

print(unbounded)

For some reason unbounded isn't caught by E0601 (or other rule.. but it should be caught by something...)

If a simpler condition is used the problem doesn't happen

if 1 == 2:
    unbounded = True

print(unbounded)

Configuration

No response

Command used

pylint test.py --disable=missing-module-docstring,invalid-name

Pylint output

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

Expected behavior

I would expect pylint to detect E0601 on this code

Pylint version

pylint 2.17.4
astroid 2.15.5
Python 3.8.7 (default, Oct 29 2022, 08:49:12)

OS / Environment

No response

Additional dependencies

No response

@alonme alonme added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jun 18, 2023
@jacobtylerwalls
Copy link
Member

Thanks for the report. Will be marking as duplicate of #1727. pylint has more reusable utilities to facilitate implementing this now, in 2023, than when it was first proposed 👍

@jacobtylerwalls jacobtylerwalls closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2023
@jacobtylerwalls jacobtylerwalls added Duplicate 🐫 Duplicate of an already existing issue C: used-before-assignment Issues related to 'used-before-assignment' check and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: used-before-assignment Issues related to 'used-before-assignment' check Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants