File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from mypy .nodes import ARG_POS , ARG_STAR , ArgKind , Var
7
7
from mypy .state import state
8
- from mypy .type_visitor import TypeTranslator
9
8
from mypy .types import (
10
9
ANY_STRATEGY ,
11
10
AnyType ,
44
43
)
45
44
from mypy .typevartuples import find_unpack_in_list , split_with_instance
46
45
46
+ # Solving the import cycle:
47
+ import mypy .type_visitor # ruff: isort: skip
48
+
47
49
# WARNING: these functions should never (directly or indirectly) depend on
48
50
# is_subtype(), meet_types(), join_types() etc.
49
51
# TODO: add a static dependency test for this.
@@ -167,7 +169,7 @@ def freshen_all_functions_type_vars(t: T) -> T:
167
169
return result
168
170
169
171
170
- class FreshenCallableVisitor (TypeTranslator ):
172
+ class FreshenCallableVisitor (mypy . type_visitor . TypeTranslator ):
171
173
def visit_callable_type (self , t : CallableType ) -> Type :
172
174
result = super ().visit_callable_type (t )
173
175
assert isinstance (result , ProperType ) and isinstance (result , CallableType )
Original file line number Diff line number Diff line change 5
5
import re
6
6
from unittest import TestCase , skipUnless
7
7
8
- import mypy .expandtype
9
8
from mypy .erasetype import erase_type , remove_instance_last_known_values
10
- from mypy .expandtype import expand_type
11
9
from mypy .indirection import TypeIndirectionVisitor
12
10
from mypy .join import join_simple , join_types
13
11
from mypy .meet import meet_types , narrow_declared_type
53
51
has_recursive_types ,
54
52
)
55
53
54
+ # Solving the import cycle:
55
+ import mypy .expandtype # ruff: isort: skip
56
+
56
57
57
58
class TypesSuite (Suite ):
58
59
def setUp (self ) -> None :
@@ -268,7 +269,7 @@ def assert_expand(
268
269
for id , t in map_items :
269
270
lower_bounds [id ] = t
270
271
271
- exp = expand_type (orig , lower_bounds )
272
+ exp = mypy . expandtype . expand_type (orig , lower_bounds )
272
273
# Remove erased tags (asterisks).
273
274
assert_equal (str (exp ).replace ("*" , "" ), str (result ))
274
275
You can’t perform that action at this time.
0 commit comments