-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18f03b7
commit cb6db06
Showing
4 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Fix a crash in ``undefined-loop-variable`` when providing the ``iterable`` argument to ``enumerate()``. | ||
|
||
Closes #9875 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""https://github.com/pylint-dev/pylint/issues/9875""" | ||
# value = 0 | ||
for idx, value in enumerate(iterable=[1, 2, 3]): | ||
print(f'{idx=} {value=}') | ||
# +1: [undefined-loop-variable, undefined-loop-variable] | ||
for idx, value in enumerate(iterable=[value-1, value-2*1]): | ||
print(f'{idx=} {value=}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
undefined-loop-variable:6:38:6:43::Using possibly undefined loop variable 'value':UNDEFINED | ||
undefined-loop-variable:6:47:6:52::Using possibly undefined loop variable 'value':UNDEFINED |