Skip to content

Commit 56c8c80

Browse files
Pierre-SassoulasDanielNoord
authored andcommitted
[refactor] Use for v in *.values() instead of _, v in *.items()
1 parent ae524f3 commit 56c8c80

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pylint/checkers/refactoring/refactoring_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ def _find_lower_upper_bounds(comparison_node, uses):
12781278
if isinstance(comparison_node, nodes.Compare):
12791279
_find_lower_upper_bounds(comparison_node, uses)
12801280

1281-
for _, bounds in uses.items():
1281+
for bounds in uses.values():
12821282
num_shared = len(bounds["lower_bound"].intersection(bounds["upper_bound"]))
12831283
num_lower_bounds = len(bounds["lower_bound"])
12841284
num_upper_bounds = len(bounds["upper_bound"])

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ disable=
103103
protected-access,
104104
too-few-public-methods,
105105
# handled by black
106-
format
106+
format,
107107

108108

109109
[REPORTS]

tests/pyreverse/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class A:
7373
"""
7474
node = astroid.extract_node(assign)
7575
instance_attrs = node.instance_attrs
76-
for _, assign_attrs in instance_attrs.items():
76+
for assign_attrs in instance_attrs.values():
7777
for assign_attr in assign_attrs:
7878
got = get_annotation(assign_attr).name
7979
assert isinstance(assign_attr, nodes.AssignAttr)

0 commit comments

Comments
 (0)