Skip to content

Commit eaf0b12

Browse files
committed
Clean up more no-longer version dependent typing
1 parent 7c925da commit eaf0b12

File tree

10 files changed

+16
-23
lines changed

10 files changed

+16
-23
lines changed

pandas/_libs/lib.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from typing import (
1111
Final,
1212
Literal,
1313
TypeAlias,
14+
TypeGuard,
1415
overload,
1516
)
1617

@@ -19,7 +20,6 @@ import numpy as np
1920
from pandas._typing import (
2021
ArrayLike,
2122
DtypeObj,
22-
TypeGuard,
2323
npt,
2424
)
2525

pandas/_typing.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
TYPE_CHECKING,
2121
Any,
2222
Literal,
23+
ParamSpec,
2324
Protocol,
25+
SupportsIndex,
2426
TypeAlias,
2527
TypeVar,
2628
Union,
@@ -84,18 +86,8 @@
8486
# Name "npt._ArrayLikeInt_co" is not defined [name-defined]
8587
NumpySorter: TypeAlias = npt._ArrayLikeInt_co | None # type: ignore[name-defined]
8688

87-
from typing import (
88-
ParamSpec,
89-
SupportsIndex,
90-
)
91-
from typing import Concatenate # pyright: ignore[reportUnusedImport]
92-
from typing import TypeGuard # pyright: ignore[reportUnusedImport]
93-
94-
P = ParamSpec("P")
95-
else:
96-
ParamSpec: Any = None
97-
TypeGuard: Any = None
98-
Concatenate: Any = None
89+
90+
P = ParamSpec("P")
9991

10092
HashableT = TypeVar("HashableT", bound=Hashable)
10193
HashableT2 = TypeVar("HashableT2", bound=Hashable)

pandas/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from typing import (
2626
TYPE_CHECKING,
2727
Any,
28+
Concatenate,
2829
TypeVar,
2930
cast,
3031
overload,
@@ -51,7 +52,6 @@
5152
from pandas._typing import (
5253
AnyArrayLike,
5354
ArrayLike,
54-
Concatenate,
5555
NpDtype,
5656
P,
5757
RandomState,

pandas/core/dtypes/inference.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
from numbers import Number
77
import re
88
from re import Pattern
9-
from typing import TYPE_CHECKING
9+
from typing import (
10+
TYPE_CHECKING,
11+
TypeGuard,
12+
)
1013

1114
import numpy as np
1215

@@ -15,8 +18,6 @@
1518
if TYPE_CHECKING:
1619
from collections.abc import Hashable
1720

18-
from pandas._typing import TypeGuard
19-
2021
is_bool = lib.is_bool
2122

2223
is_integer = lib.is_integer

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
TYPE_CHECKING,
1515
Any,
1616
ClassVar,
17+
Concatenate,
1718
Literal,
1819
NoReturn,
1920
Self,
@@ -42,7 +43,6 @@
4243
Axis,
4344
AxisInt,
4445
CompressionOptions,
45-
Concatenate,
4646
DtypeArg,
4747
DtypeBackend,
4848
DtypeObj,

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class providing the base-class of operations.
2525
from textwrap import dedent
2626
from typing import (
2727
TYPE_CHECKING,
28+
Concatenate,
2829
Literal,
2930
Self,
3031
TypeAlias,
@@ -147,7 +148,6 @@ class providing the base-class of operations.
147148
from pandas._libs.tslibs.timedeltas import Timedelta
148149
from pandas._typing import (
149150
Any,
150-
Concatenate,
151151
P,
152152
T,
153153
)

pandas/core/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from textwrap import dedent
55
from typing import (
66
TYPE_CHECKING,
7+
Concatenate,
78
Literal,
89
Self,
910
cast,
@@ -97,7 +98,6 @@
9798
Any,
9899
AnyArrayLike,
99100
Axis,
100-
Concatenate,
101101
FreqIndexT,
102102
Frequency,
103103
IndexLabel,

pandas/core/window/expanding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import (
55
TYPE_CHECKING,
66
Any,
7+
Concatenate,
78
Literal,
89
Self,
910
final,
@@ -42,7 +43,6 @@
4243
from collections.abc import Callable
4344

4445
from pandas._typing import (
45-
Concatenate,
4646
P,
4747
QuantileInterpolation,
4848
T,

pandas/core/window/rolling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import (
1414
TYPE_CHECKING,
1515
Any,
16+
Concatenate,
1617
Literal,
1718
Self,
1819
final,
@@ -110,7 +111,6 @@
110111

111112
from pandas._typing import (
112113
ArrayLike,
113-
Concatenate,
114114
NDFrameT,
115115
QuantileInterpolation,
116116
P,

pandas/io/formats/style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import textwrap
1111
from typing import (
1212
TYPE_CHECKING,
13+
Concatenate,
1314
Self,
1415
overload,
1516
)
@@ -67,7 +68,6 @@
6768
Any,
6869
Axis,
6970
AxisInt,
70-
Concatenate,
7171
ExcelWriterMergeCells,
7272
FilePath,
7373
IndexLabel,

0 commit comments

Comments
 (0)