|
4 | 4 | from mypy.subtypes import is_equivalent
|
5 | 5 | from mypy.types import Instance
|
6 | 6 | from mypy.types import Type as MypyType
|
7 | | -from mypy.types import UnionType, union_items |
| 7 | +from mypy.types import UnionType |
8 | 8 | from typing_extensions import final
|
9 | 9 |
|
10 | | -from classes.contrib.mypy.typeops import type_loader |
| 10 | +from classes.contrib.mypy.typeops import type_loader, union |
11 | 11 |
|
12 | 12 |
|
13 | 13 | @final
|
@@ -78,7 +78,7 @@ def __init__(
|
78 | 78 | """
|
79 | 79 | self._associated_type = associated_type
|
80 | 80 | self._ctx = ctx
|
81 | | - self._instance_types = union_items(instance_type) |
| 81 | + self._instance_types = union.union_items(instance_type) |
82 | 82 |
|
83 | 83 | # Why do we store added types in a mutable global state?
|
84 | 84 | # Because, these types are hard to replicate without the proper context.
|
@@ -181,7 +181,7 @@ def _remove_unified_type(
|
181 | 181 | base = instance_type.type.bases[index]
|
182 | 182 | union_types = [
|
183 | 183 | type_arg
|
184 | | - for type_arg in union_items(base.args[0]) |
| 184 | + for type_arg in union.union_items(base.args[0]) |
185 | 185 | if type_arg not in supports_type.args
|
186 | 186 | ]
|
187 | 187 | instance_type.type.bases[index] = supports_type.copy_modified(
|
|
0 commit comments