Skip to content

Commit c546c1b

Browse files
committed
fix pre-commit (pyright + mypy)
1 parent a19921a commit c546c1b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/indexes/range.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class RangeIndex(NumericIndex):
9898
_dtype_validation_metadata = (is_signed_integer_dtype, "signed integer")
9999
_range: range
100100
_values: np.ndarray
101-
_should_fallback_to_positional = False
102101

103102
@property
104103
def _engine_type(self) -> type[libindex.Int64Engine]:
@@ -195,7 +194,7 @@ def _validate_dtype(cls, dtype: Dtype | None) -> None:
195194
# error: Return type "Type[Index]" of "_constructor" incompatible with return
196195
# type "Type[RangeIndex]" in supertype "Index"
197196
@cache_readonly
198-
def _constructor(self) -> type[Index]:
197+
def _constructor(self) -> type[Index]: # type: ignore[override]
199198
"""return the class to use for construction"""
200199
return NumericIndex
201200

@@ -379,6 +378,13 @@ def _get_indexer(
379378
locs[valid] = len(self) - 1 - locs[valid]
380379
return ensure_platform_int(locs)
381380

381+
@cache_readonly
382+
def _should_fallback_to_positional(self) -> bool:
383+
"""
384+
Should an integer key be treated as positional?
385+
"""
386+
return False
387+
382388
# --------------------------------------------------------------------
383389

384390
def tolist(self) -> list[int]:

0 commit comments

Comments
 (0)