Skip to content

Commit b7938b1

Browse files
committed
Use better variable names
1 parent 3b460ee commit b7938b1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pylint/checkers/match_statements_checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def visit_match(self, node: nodes.Match) -> None:
3737
"""
3838
for idx, case in enumerate(node.cases):
3939
match case.pattern:
40-
case nodes.MatchAs(pattern=None, name=nodes.AssignName(name=n)) if (
40+
case nodes.MatchAs(pattern=None, name=nodes.AssignName(name=name)) if (
4141
idx < len(node.cases) - 1
4242
):
4343
self.add_message(
4444
"bare-name-capture-pattern",
4545
node=case.pattern,
46-
args=n,
46+
args=name,
4747
confidence=HIGH,
4848
)
4949

pylint/extensions/private_import.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,21 @@ def _populate_type_annotations_annotation(
196196
or a Subscript e.g. `Optional[type]` or an Attribute, e.g. `pylint.lint.linter`.
197197
"""
198198
match node:
199-
case nodes.Name(name=n) if n not in all_used_type_annotations:
200-
all_used_type_annotations[n] = True
201-
return n # type: ignore[no-any-return]
202-
case nodes.Subscript(slice=s, value=v):
199+
case nodes.Name(name=name) if name not in all_used_type_annotations:
200+
all_used_type_annotations[name] = True
201+
return name # type: ignore[no-any-return]
202+
case nodes.Subscript(slice=s, value=value):
203203
# slice is the next nested type
204204
self._populate_type_annotations_annotation(s, all_used_type_annotations)
205205
# value is the current type name: could be a Name or Attribute
206206
return self._populate_type_annotations_annotation(
207-
v, all_used_type_annotations
207+
value, all_used_type_annotations
208208
)
209-
case nodes.Attribute(expr=e):
209+
case nodes.Attribute(expr=expr):
210210
# An attribute is a type like `pylint.lint.pylinter`. node.expr is the next level
211211
# up, could be another attribute
212212
return self._populate_type_annotations_annotation(
213-
e, all_used_type_annotations
213+
expr, all_used_type_annotations
214214
)
215215
return None
216216

0 commit comments

Comments
 (0)