You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimalexample:
Whenparsingthefollowing``a.py``:
"""Example for Astroid Error"""# value = 0foridx, valueinenumerate(iterable=[1, 2, 3]):
print(f'{idx=}{value=}')
foridx, valueinenumerate(iterable=[value-1, value-2*1]):
print(f'{idx=}{value=}')
If value is defined before the loop, everything is fine. I'd rather expect a "undefined-loop-variable" warning.
Output is as expected: idx=0 value=1 idx=1 value=2 idx=2 value=3 idx=0 value=2 idx=1 value=1
Configuration
No response
Command used
pylint a.py
Pylint output
pylint crashed with a ``AstroidError`` and with the following stacktrace:
jacobtylerwalls
added
Crash 💥
A bug that makes pylint crash
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Aug 16, 2024
Bug description
If value is defined before the loop, everything is fine. I'd rather expect a "undefined-loop-variable" warning.
Output is as expected:
idx=0 value=1
idx=1 value=2
idx=2 value=3
idx=0 value=2
idx=1 value=1
Configuration
No response
Command used
Pylint output
pylint crashed with a ``AstroidError`` and with the following stacktrace:
Expected behavior
No crash.
Pylint version
OS / Environment
linux (Linux)
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: