Skip to content

Commit b1ee03e

Browse files
committed
list
1 parent cbdaaf1 commit b1ee03e

File tree

15 files changed

+27
-38
lines changed

15 files changed

+27
-38
lines changed

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ class _CustomBusinessMonth(SingleConstructorOffset):
205205
n: int = ...,
206206
normalize: bool = ...,
207207
offset: timedelta = ...,
208-
holidays: list | None = ...,
208+
holidays: list[Any] | None = ...,
209209
) -> None: ...
210210

211211
class CustomBusinessDay(BusinessDay):
212212
def __init__(
213213
self,
214214
n: int = ...,
215215
normalize: bool = ...,
216-
holidays: list = ...,
216+
holidays: list[Any] = ...,
217217
calendar: AbstractHolidayCalendar | np.busdaycalendar = ...,
218218
) -> None: ...
219219

@@ -225,7 +225,7 @@ class CustomBusinessHour(BusinessHour):
225225
start: str | time | Collection[str | time] = ...,
226226
end: str | time | Collection[str | time] = ...,
227227
offset: timedelta = ...,
228-
holidays: list | None = ...,
228+
holidays: list[Any] | None = ...,
229229
) -> None: ...
230230

231231
class CustomBusinessMonthEnd(_CustomBusinessMonth): ...

pandas-stubs/_typing.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Level: TypeAlias = Hashable
182182
Shape: TypeAlias = tuple[int, ...]
183183
Suffixes: TypeAlias = tuple[str | None, str | None] | list[str | None]
184184
Ordered: TypeAlias = bool | None
185-
JSONSerializable: TypeAlias = PythonScalar | list | dict
185+
JSONSerializable: TypeAlias = PythonScalar | list[Any] | dict
186186
Frequency: TypeAlias = str | BaseOffset
187187
PeriodFrequency: TypeAlias = (
188188
str

pandas-stubs/core/frame.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,15 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
552552
*,
553553
into: MutableMapping | type[MutableMapping],
554554
index: bool = ...,
555-
) -> MutableMapping[str, list]: ...
555+
) -> MutableMapping[str, list[Any]]: ...
556556
@overload
557557
def to_dict(
558558
self,
559559
orient: Literal["split", "tight"],
560560
*,
561561
into: type[dict] = ...,
562562
index: bool = ...,
563-
) -> dict[str, list]: ...
563+
) -> dict[str, list[Any]]: ...
564564
@classmethod
565565
def from_records(
566566
cls,
@@ -1256,7 +1256,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
12561256
keep: NsmallestNlargestKeep = "first",
12571257
) -> Self: ...
12581258
def swaplevel(self, i: Level = ..., j: Level = ..., axis: Axis = 0) -> Self: ...
1259-
def reorder_levels(self, order: list, axis: Axis = 0) -> Self: ...
1259+
def reorder_levels(self, order: list[int] | list[str], axis: Axis = 0) -> Self: ...
12601260
def compare(
12611261
self,
12621262
other: DataFrame,
@@ -1796,7 +1796,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
17961796
def hist(
17971797
self,
17981798
by: _str | ListLike | None = None,
1799-
bins: int | list = 10,
1799+
bins: int | Sequence[int] = 10,
18001800
*,
18011801
grid: _bool = True,
18021802
xlabelsize: float | str | None = None,

pandas-stubs/core/groupby/generic.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ _TT = TypeVar("_TT", bound=Literal[True, False])
219219
class DFCallable1(Protocol[P]): # ty: ignore[invalid-argument-type]
220220
def __call__(
221221
self, df: DataFrame, /, *args: P.args, **kwargs: P.kwargs
222-
) -> Scalar | list | dict: ...
222+
) -> Scalar | list[Any] | dict: ...
223223

224224
class DFCallable2(Protocol[P]): # ty: ignore[invalid-argument-type]
225225
def __call__(

pandas-stubs/core/indexes/base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
477477
def intersection(
478478
self, other: list[S1] | Self, sort: bool | None = False
479479
) -> Self: ...
480-
def difference(self, other: list | Self, sort: bool | None = None) -> Self: ...
480+
def difference(self, other: list[Any] | Self, sort: bool | None = None) -> Self: ...
481481
def symmetric_difference(
482482
self,
483483
other: list[S1] | Self,

pandas-stubs/core/indexes/multi.pyi

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections.abc import (
2-
Callable,
32
Collection,
43
Hashable,
54
Iterable,
@@ -91,16 +90,6 @@ class MultiIndex(Index):
9190
def memory_usage(self, deep: bool = False) -> int: ...
9291
@property
9392
def nbytes(self) -> int: ...
94-
def format(
95-
self,
96-
name: bool | None = ...,
97-
formatter: Callable[..., Any] | None = ...,
98-
na_rep: str | None = ...,
99-
names: bool = ...,
100-
space: int = ...,
101-
sparsify: bool | None = ...,
102-
adjoin: bool = ...,
103-
) -> list: ...
10493
def __len__(self) -> int: ...
10594
@property
10695
def values(self): ...

pandas-stubs/core/reshape/pivot.pyi

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ from pandas._typing import (
2828
Label,
2929
Scalar,
3030
ScalarT,
31+
SequenceNotStr,
3132
np_ndarray,
3233
)
3334

@@ -61,6 +62,7 @@ _PivotTableColumnsTypes: TypeAlias = (
6162
_PivotTableValuesTypes: TypeAlias = Label | Sequence[HashableT3] | None
6263

6364
_ExtendedAnyArrayLike: TypeAlias = AnyArrayLike | ArrayLike
65+
_Values: TypeAlias = SequenceNotStr[Any] | _ExtendedAnyArrayLike
6466

6567
@overload
6668
def pivot_table(
@@ -123,9 +125,9 @@ def pivot(
123125
) -> DataFrame: ...
124126
@overload
125127
def crosstab(
126-
index: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike],
127-
columns: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike],
128-
values: list | _ExtendedAnyArrayLike,
128+
index: _Values | list[_Values],
129+
columns: _Values | list[_Values],
130+
values: _Values,
129131
rownames: list[HashableT1] | None = ...,
130132
colnames: list[HashableT2] | None = ...,
131133
*,
@@ -137,8 +139,8 @@ def crosstab(
137139
) -> DataFrame: ...
138140
@overload
139141
def crosstab(
140-
index: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike],
141-
columns: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike],
142+
index: _Values | list[_Values],
143+
columns: _Values | list[_Values],
142144
values: None = None,
143145
rownames: list[HashableT1] | None = ...,
144146
colnames: list[HashableT2] | None = ...,

pandas-stubs/core/series.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
564564
def __array__( # ty: ignore[invalid-method-override]
565565
self, dtype: _str | np.dtype = ..., copy: bool | None = ...
566566
) -> np_1darray: ...
567-
@property
568-
def axes(self) -> list: ...
569567
@final
570568
def __getattr__(self, name: _str) -> S1: ...
571569

pandas-stubs/io/formats/style.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ from pandas.io.formats.style_render import (
5050
class _SeriesFunc(Protocol):
5151
def __call__(
5252
self, series: Series, /, *args: Any, **kwargs: Any
53-
) -> list | Series: ...
53+
) -> list[Any] | Series: ...
5454

5555
class _DataFrameFunc(Protocol):
5656
def __call__(
@@ -233,7 +233,7 @@ class Styler(StylerRenderer):
233233
@overload
234234
def apply(
235235
self,
236-
func: _SeriesFunc | Callable[[Series], list | Series],
236+
func: _SeriesFunc | Callable[[Series], list[Any] | Series],
237237
axis: Axis = ...,
238238
subset: Subset | None = ...,
239239
**kwargs: Any,

pandas-stubs/io/json/_normalize.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from pandas._typing import IgnoreRaise
44

55
def json_normalize(
66
data: dict | list[dict],
7-
record_path: str | list | None = None,
7+
record_path: str | list[str] | None = None,
88
meta: str | list[str | list[str]] | None = None,
99
meta_prefix: str | None = None,
1010
record_prefix: str | None = None,

0 commit comments

Comments
 (0)