Skip to content

Commit 842b57d

Browse files
kkleinYi Wei
authored and
Yi Wei
committed
TYP: Narrow down type of method keyword in Index (pandas-dev#52723)
* Add literal type hint. * Move type variable to _typing.py. * Use existing type alias. * EOF
1 parent 715e7dc commit 842b57d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/indexes/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
JoinHow,
5757
Level,
5858
NaPosition,
59+
ReindexMethod,
5960
Self,
6061
Shape,
6162
npt,
@@ -208,7 +209,6 @@
208209
_index_shared_docs: dict[str, str] = {}
209210
str_t = str
210211

211-
212212
_dtype_obj = np.dtype("object")
213213

214214
_masked_engines = {
@@ -3746,7 +3746,7 @@ def get_loc(self, key):
37463746
def get_indexer(
37473747
self,
37483748
target,
3749-
method: str_t | None = None,
3749+
method: ReindexMethod | None = None,
37503750
limit: int | None = None,
37513751
tolerance=None,
37523752
) -> npt.NDArray[np.intp]:
@@ -4199,7 +4199,7 @@ def _validate_can_reindex(self, indexer: np.ndarray) -> None:
41994199
def reindex(
42004200
self,
42014201
target,
4202-
method=None,
4202+
method: ReindexMethod | None = None,
42034203
level=None,
42044204
limit: int | None = None,
42054205
tolerance: float | None = None,

0 commit comments

Comments
 (0)