Skip to content

Commit fac9e80

Browse files
committed
Index: ensure Index(DatetimeIndex) returns DatetimeIndex (fixes #1440)
1 parent 6957ad1 commit fac9e80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas-stubs/core/indexes/base.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,16 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
274274
name: Hashable = ...,
275275
tupleize_cols: bool = ...,
276276
) -> IntervalIndex[Interval[Any]]: ...
277+
@overload
278+
def __new__(
279+
cls,
280+
data: DatetimeIndex,
281+
*,
282+
dtype: TimestampDtypeArg | None = ...,
283+
copy: bool = ...,
284+
name: Hashable = ...,
285+
tupleize_cols: bool = ...,
286+
) -> DatetimeIndex: ...
277287
# generic overloads
278288
@overload
279289
def __new__(

0 commit comments

Comments
 (0)