Skip to content

Commit 2a6e6eb

Browse files
committed
Use _typing.T instead of locally defined type var
1 parent 87ec9c1 commit 2a6e6eb

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

pandas-stubs/core/frame.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ from typing import (
1313
Any,
1414
ClassVar,
1515
Literal,
16-
TypeVar,
1716
overload,
1817
)
1918

@@ -115,6 +114,7 @@ from pandas._typing import (
115114
StorageOptions,
116115
StrLike,
117116
Suffixes,
117+
T as _T,
118118
TimestampConvention,
119119
ValidationOptions,
120120
WriteBuffer,
@@ -129,8 +129,6 @@ from pandas.plotting import PlotAccessor
129129
_str = str
130130
_bool = bool
131131

132-
_T = TypeVar("_T")
133-
134132
class _iLocIndexerFrame(_iLocIndexer):
135133
@overload
136134
def __getitem__(self, idx: tuple[int, int]) -> Scalar: ...

pandas-stubs/core/series.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ from typing import (
1818
ClassVar,
1919
Generic,
2020
Literal,
21-
TypeVar,
2221
overload,
2322
)
2423

@@ -142,6 +141,7 @@ from pandas._typing import (
142141
SortKind,
143142
StrDtypeArg,
144143
StrLike,
144+
T,
145145
TimedeltaDtypeArg,
146146
TimestampConvention,
147147
TimestampDtypeArg,
@@ -161,8 +161,6 @@ from pandas.plotting import PlotAccessor
161161
_bool = bool
162162
_str = str
163163

164-
_T = TypeVar("_T")
165-
166164
class _iLocIndexerSeries(_iLocIndexer, Generic[S1]):
167165
# get item
168166
@overload
@@ -389,7 +387,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
389387
@overload
390388
def get(self, key: Hashable, default: S1) -> S1: ...
391389
@overload
392-
def get(self, key: Hashable, default: _T) -> S1 | _T: ...
390+
def get(self, key: Hashable, default: T) -> S1 | T: ...
393391
def repeat(
394392
self, repeats: int | list[int], axis: AxisIndex | None = ...
395393
) -> Series[S1]: ...

0 commit comments

Comments
 (0)