File tree 1 file changed +4
-7
lines changed 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -4341,14 +4341,11 @@ def visit_index_with_type(
4341
4341
elif isinstance (left_type , FunctionLike ) and left_type .is_type_obj ():
4342
4342
if left_type .type_object ().is_enum :
4343
4343
return self .visit_enum_index_expr (left_type .type_object (), e .index , e )
4344
- elif left_type .type_object ().type_vars and self .chk .options .python_version >= (3 , 9 ):
4345
- return self .named_type ("types.GenericAlias" )
4346
- elif (
4347
- left_type .type_object ().fullname == "builtins.type"
4348
- and self .chk .options .python_version >= (3 , 9 )
4344
+ elif self .chk .options .python_version >= (3 , 9 ) and (
4345
+ left_type .type_object ().type_vars
4346
+ or left_type .type_object ().fullname == "builtins.type"
4349
4347
):
4350
- # builtins.type is special: it's not generic in stubs, but it supports indexing
4351
- return self .named_type ("typing._SpecialForm" )
4348
+ return self .named_type ("types.GenericAlias" )
4352
4349
4353
4350
if isinstance (left_type , TypeVarType ) and not self .has_member (
4354
4351
left_type .upper_bound , "__getitem__"
You can’t perform that action at this time.
0 commit comments