Skip to content

Commit 9f57283

Browse files
committed
Reuse types
1 parent 3ca0d08 commit 9f57283

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pandas/_libs/ops.pyi

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
from typing import (
2-
TYPE_CHECKING,
32
Iterable,
43
Literal,
54
overload,
65
)
76

87
import numpy as np
98

10-
if TYPE_CHECKING: # noqa: PYI002
11-
from pandas._typing import (
12-
BinOp,
13-
BoolOp,
14-
npt,
15-
)
9+
from pandas._typing import (
10+
BinOp,
11+
BoolOp,
12+
npt,
13+
)
1614

1715
def scalar_compare(
1816
values: np.ndarray, # object[:]

pandas/_typing.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
Optional,
2424
Protocol,
2525
Type as type_t,
26-
TypeAlias,
2726
TypeVar,
2827
Union,
2928
overload,
@@ -94,13 +93,17 @@
9493
from typing import SupportsIndex
9594

9695
if sys.version_info >= (3, 10):
96+
from typing import (
97+
ParamSpec,
98+
TypeAlias,
99+
)
97100
from typing import Concatenate # pyright: ignore[reportUnusedImport]
98-
from typing import ParamSpec
99101
from typing import TypeGuard # pyright: ignore[reportUnusedImport]
100102
else:
101103
from typing_extensions import ( # pyright: ignore[reportUnusedImport]
102104
Concatenate,
103105
ParamSpec,
106+
TypeAlias,
104107
TypeGuard,
105108
)
106109

0 commit comments

Comments
 (0)