@@ -51,20 +51,24 @@ def is_special_target(right: ProperType) -> bool:
5151 if right .type_object ().fullname == 'builtins.tuple' :
5252 # Used with Union[Type, Tuple[Type, ...]].
5353 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+ ):
5759 # Special case: things like assert isinstance(typ, ProperType) are always OK.
5860 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+ ):
6872 # Special case: these are not valid targets for a type alias and thus safe.
6973 # TODO: introduce a SyntheticType base to simplify this?
7074 return True
0 commit comments