File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -3373,7 +3373,7 @@ def analyze_alias(
3373
3373
tvar_def = self .tvar_scope .bind_new (name , tvar_expr )
3374
3374
tvar_defs .append (tvar_def )
3375
3375
3376
- res = analyze_type_alias (
3376
+ analyzed , depends_on = analyze_type_alias (
3377
3377
typ ,
3378
3378
self ,
3379
3379
self .tvar_scope ,
@@ -3385,13 +3385,8 @@ def analyze_alias(
3385
3385
global_scope = global_scope ,
3386
3386
allowed_alias_tvars = tvar_defs ,
3387
3387
)
3388
- analyzed : Type | None = None
3389
- if res :
3390
- analyzed , depends_on = res
3391
- qualified_tvars = [node .fullname for (name , node ) in found_type_vars ]
3392
- else :
3393
- depends_on = set ()
3394
- qualified_tvars = []
3388
+
3389
+ qualified_tvars = [node .fullname for _name , node in found_type_vars ]
3395
3390
return analyzed , tvar_defs , depends_on , qualified_tvars
3396
3391
3397
3392
def is_pep_613 (self , s : AssignmentStmt ) -> bool :
Original file line number Diff line number Diff line change @@ -132,12 +132,12 @@ def analyze_type_alias(
132
132
in_dynamic_func : bool = False ,
133
133
global_scope : bool = True ,
134
134
allowed_alias_tvars : list [TypeVarLikeType ] | None = None ,
135
- ) -> tuple [Type , set [str ]] | None :
135
+ ) -> tuple [Type , set [str ]]:
136
136
"""Analyze r.h.s. of a (potential) type alias definition.
137
137
138
138
If `node` is valid as a type alias rvalue, return the resulting type and a set of
139
139
full names of type aliases it depends on (directly or indirectly).
140
- Return None otherwise. 'node' must have been semantically analyzed.
140
+ 'node' must have been semantically analyzed.
141
141
"""
142
142
analyzer = TypeAnalyser (
143
143
api ,
You can’t perform that action at this time.
0 commit comments