@@ -196,21 +196,21 @@ def _populate_type_annotations_annotation(
196
196
or a Subscript e.g. `Optional[type]` or an Attribute, e.g. `pylint.lint.linter`.
197
197
"""
198
198
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 ):
203
203
# slice is the next nested type
204
204
self ._populate_type_annotations_annotation (s , all_used_type_annotations )
205
205
# value is the current type name: could be a Name or Attribute
206
206
return self ._populate_type_annotations_annotation (
207
- v , all_used_type_annotations
207
+ value , all_used_type_annotations
208
208
)
209
- case nodes .Attribute (expr = e ):
209
+ case nodes .Attribute (expr = expr ):
210
210
# An attribute is a type like `pylint.lint.pylinter`. node.expr is the next level
211
211
# up, could be another attribute
212
212
return self ._populate_type_annotations_annotation (
213
- e , all_used_type_annotations
213
+ expr , all_used_type_annotations
214
214
)
215
215
return None
216
216
0 commit comments