Skip to content

Commit f916868

Browse files
GH828 Replace Iterable with Axes for Index.__new__/Index.__init__
1 parent 9c02c36 commit f916868

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pandas-stubs/core/indexes/base.pyi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ from typing_extensions import (
4242
from pandas._libs.interval import _OrderableT
4343
from pandas._typing import (
4444
S1,
45+
Axes,
4546
Dtype,
4647
DtypeArg,
4748
DtypeObj,
@@ -81,7 +82,7 @@ class Index(IndexOpsMixin[S1]):
8182
@overload
8283
def __new__(
8384
cls,
84-
data: Iterable,
85+
data: Axes,
8586
*,
8687
dtype: Literal["int"] | type_t[int | np.integer],
8788
copy: bool = ...,
@@ -103,7 +104,7 @@ class Index(IndexOpsMixin[S1]):
103104
@overload
104105
def __new__(
105106
cls,
106-
data: Iterable,
107+
data: Axes,
107108
*,
108109
dtype: Literal["float"] | type_t[float | np.floating],
109110
copy: bool = ...,
@@ -129,7 +130,7 @@ class Index(IndexOpsMixin[S1]):
129130
@overload
130131
def __new__(
131132
cls,
132-
data: Iterable,
133+
data: Axes,
133134
*,
134135
dtype: Literal["complex"] | type_t[complex | np.complexfloating],
135136
copy: bool = ...,
@@ -152,7 +153,7 @@ class Index(IndexOpsMixin[S1]):
152153
@overload
153154
def __new__(
154155
cls,
155-
data: Iterable,
156+
data: Axes,
156157
*,
157158
dtype: TimestampDtypeArg,
158159
copy: bool = ...,
@@ -174,7 +175,7 @@ class Index(IndexOpsMixin[S1]):
174175
@overload
175176
def __new__(
176177
cls,
177-
data: Iterable,
178+
data: Axes,
178179
*,
179180
dtype: PeriodDtype,
180181
copy: bool = ...,
@@ -196,7 +197,7 @@ class Index(IndexOpsMixin[S1]):
196197
@overload
197198
def __new__(
198199
cls,
199-
data: Iterable,
200+
data: Axes,
200201
*,
201202
dtype: TimedeltaDtypeArg,
202203
copy: bool = ...,
@@ -218,7 +219,7 @@ class Index(IndexOpsMixin[S1]):
218219
@overload
219220
def __new__(
220221
cls,
221-
data: Iterable,
222+
data: Axes,
222223
*,
223224
dtype: Literal["Interval"],
224225
copy: bool = ...,
@@ -241,7 +242,7 @@ class Index(IndexOpsMixin[S1]):
241242
@overload
242243
def __new__(
243244
cls,
244-
data: Iterable = ...,
245+
data: Axes = ...,
245246
*,
246247
dtype: type[S1],
247248
copy: bool = ...,
@@ -253,7 +254,7 @@ class Index(IndexOpsMixin[S1]):
253254
@overload
254255
def __new__(
255256
cls,
256-
data: Iterable,
257+
data: Axes,
257258
*,
258259
dtype=...,
259260
copy: bool = ...,

0 commit comments

Comments
 (0)