Skip to content

Commit 7cb3db7

Browse files
committed
New union
1 parent c4a969e commit 7cb3db7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

classes/contrib/mypy/typeops/instance_args.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from typing import List, Union
22

33
from mypy.plugin import FunctionContext, MethodContext
4+
from mypy.typeops import make_simplified_union
45
from mypy.types import AnyType, Instance, LiteralType, TupleType
56
from mypy.types import Type as MypyType
6-
from mypy.types import TypeVarType, UnboundType, UninhabitedType, UnionType
7+
from mypy.types import TypeVarType, UnboundType, UninhabitedType
78
from typing_extensions import Final
89

910
#: Types that pollute instance args.
@@ -31,7 +32,7 @@ def add_unique(
3132
lambda type_: not isinstance(type_, _TYPES_TO_FILTER_OUT),
3233
[new_instance_type, existing_instance_type],
3334
)))
34-
return UnionType.make_union(unified)
35+
return make_simplified_union(unified)
3536

3637

3738
def mutate_typeclass_def(

0 commit comments

Comments
 (0)