@@ -51,20 +51,24 @@ def is_special_target(right: ProperType) -> bool:
51
51
if right .type_object ().fullname == 'builtins.tuple' :
52
52
# Used with Union[Type, Tuple[Type, ...]].
53
53
return True
54
- if right .type_object ().fullname in ('mypy.types.Type' ,
55
- 'mypy.types.ProperType' ,
56
- 'mypy.types.TypeAliasType' ):
54
+ if right .type_object ().fullname in (
55
+ 'mypy.types.Type' ,
56
+ 'mypy.types.ProperType' ,
57
+ 'mypy.types.TypeAliasType'
58
+ ):
57
59
# Special case: things like assert isinstance(typ, ProperType) are always OK.
58
60
return True
59
- if right .type_object ().fullname in ('mypy.types.UnboundType' ,
60
- 'mypy.types.TypeVarType' ,
61
- 'mypy.types.RawExpressionType' ,
62
- 'mypy.types.EllipsisType' ,
63
- 'mypy.types.StarType' ,
64
- 'mypy.types.TypeList' ,
65
- 'mypy.types.CallableArgument' ,
66
- 'mypy.types.PartialType' ,
67
- 'mypy.types.ErasedType' ):
61
+ if right .type_object ().fullname in (
62
+ 'mypy.types.UnboundType' ,
63
+ 'mypy.types.TypeVarType' ,
64
+ 'mypy.types.RawExpressionType' ,
65
+ 'mypy.types.EllipsisType' ,
66
+ 'mypy.types.StarType' ,
67
+ 'mypy.types.TypeList' ,
68
+ 'mypy.types.CallableArgument' ,
69
+ 'mypy.types.PartialType' ,
70
+ 'mypy.types.ErasedType'
71
+ ):
68
72
# Special case: these are not valid targets for a type alias and thus safe.
69
73
# TODO: introduce a SyntheticType base to simplify this?
70
74
return True
0 commit comments