File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from __future__ import annotations
4
4
5
- from collections .abc import Iterator
6
5
from typing import (
7
6
Any ,
8
7
TypeVar ,
9
8
Protocol ,
10
9
runtime_checkable ,
10
+ TYPE_CHECKING ,
11
11
)
12
12
13
+ if TYPE_CHECKING :
14
+ from collections .abc import Iterator
15
+
13
16
__all__ = ["_NestedSequence" ]
14
17
15
18
_T_co = TypeVar ("_T_co" , covariant = True )
Original file line number Diff line number Diff line change 33
33
34
34
from __future__ import annotations
35
35
36
- from collections .abc import Iterable
37
36
from typing import Final , TYPE_CHECKING , Callable
38
37
39
38
import numpy as np
40
39
40
+ if TYPE_CHECKING :
41
+ from collections .abc import Iterable
42
+
41
43
try :
42
44
import mypy .types
43
45
from mypy .types import Type
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from typing import Any
3
+ from typing import Any , TYPE_CHECKING
4
4
5
5
import numpy as np
6
- from numpy ._typing import NDArray , ArrayLike , _SupportsArray
6
+
7
+ if TYPE_CHECKING :
8
+ from numpy ._typing import NDArray , ArrayLike , _SupportsArray
7
9
8
10
x1 : ArrayLike = True
9
11
x2 : ArrayLike = 5
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from typing import Any
3
+ from typing import Any , TYPE_CHECKING
4
4
from functools import partial
5
- from collections .abc import Callable
6
5
7
6
import pytest
8
7
import numpy as np
9
8
9
+ if TYPE_CHECKING :
10
+ from collections .abc import Callable
11
+
10
12
AR = np .array (0 )
11
13
AR .setflags (write = False )
12
14
Original file line number Diff line number Diff line change 5
5
import re
6
6
import shutil
7
7
from collections import defaultdict
8
- from collections .abc import Iterator
9
8
from typing import TYPE_CHECKING
10
9
11
10
import pytest
34
33
NO_MYPY = False
35
34
36
35
if TYPE_CHECKING :
36
+ from collections .abc import Iterator
37
37
# We need this as annotation, but it's located in a private namespace.
38
38
# As a compromise, do *not* import it during runtime
39
39
from _pytest .mark .structures import ParameterSet
You can’t perform that action at this time.
0 commit comments