Skip to content

Commit

Permalink
Last small style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed May 11, 2021
1 parent 797b050 commit d9ccab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pylint/checkers/refactoring/recommendation_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def _check_consider_using_dict_items(self, node: astroid.For) -> None:
# defined and compare that to the for loop's line number
continue
if (
isinstance(subscript.parent, (astroid.Assign))
isinstance(subscript.parent, astroid.Assign)
and subscript in subscript.parent.targets
or isinstance(subscript.parent, (astroid.AugAssign))
or isinstance(subscript.parent, astroid.AugAssign)
and subscript == subscript.parent.target
):
# Ignore this subscript if it is the target of an assignment
Expand Down Expand Up @@ -207,5 +207,6 @@ def visit_comprehension(self, node: astroid.Comprehension) -> None:
or iterating_object_name != subscript.value.as_string()
):
continue

self.add_message("consider-using-dict-items", node=node)
return

0 comments on commit d9ccab1

Please sign in to comment.