Skip to content

Commit 4518860

Browse files
committed
Sequence etc
1 parent b1ee03e commit 4518860

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

pandas-stubs/_typing.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ ListLikeT = TypeVar("ListLikeT", bound=ListLike)
966966
ListLikeExceptSeriesAndStr: TypeAlias = (
967967
MutableSequence[Any] | np_1darray | tuple[Any, ...] | Index
968968
)
969-
ListLikeU: TypeAlias = Sequence | np_1darray | Series | Index
969+
ListLikeU: TypeAlias = Sequence[Any] | np_1darray | Series | Index
970970
ListLikeHashable: TypeAlias = (
971971
MutableSequence[HashableT] | np_1darray | tuple[HashableT, ...] | range
972972
)

pandas-stubs/core/groupby/generic.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ class DFCallable2(Protocol[P]): # ty: ignore[invalid-argument-type]
227227
) -> DataFrame | Series: ...
228228

229229
class DFCallable3(Protocol[P]): # ty: ignore[invalid-argument-type]
230-
def __call__(self, df: Iterable, /, *args: P.args, **kwargs: P.kwargs) -> float: ...
230+
def __call__(
231+
self, df: Iterable[Any], /, *args: P.args, **kwargs: P.kwargs
232+
) -> float: ...
231233

232234
class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
233235
# error: Overload 3 for "apply" will never be used because its parameters overlap overload 1

pandas-stubs/core/groupby/groupby.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class GroupBy(BaseGroupBy[NDFrameT]):
334334
n: int | None = None,
335335
frac: float | None = None,
336336
replace: bool = False,
337-
weights: Sequence | Series | None = ...,
337+
weights: Sequence[float] | Series | None = ...,
338338
random_state: RandomState | None = ...,
339339
) -> NDFrameT: ...
340340

pandas-stubs/core/series.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from collections.abc import (
1111
Mapping,
1212
MutableMapping,
1313
Sequence,
14+
Set as AbstractSet,
1415
ValuesView,
1516
)
1617
from datetime import (
@@ -1169,7 +1170,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
11691170
def apply(
11701171
self,
11711172
func: Callable[
1172-
..., Scalar | Sequence | set | Mapping | NAType | frozenset | None
1173+
..., Scalar | Sequence[Any] | AbstractSet[Any] | Mapping | NAType | None
11731174
],
11741175
convertDType: _bool = ...,
11751176
args: tuple[Any, ...] = ...,
@@ -1371,7 +1372,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
13711372
ylabelsize: float | _str | None = None,
13721373
yrot: float | None = None,
13731374
figsize: tuple[float, float] | None = None,
1374-
bins: int | Sequence = 10,
1375+
bins: int | Sequence[int] = 10,
13751376
backend: _str | None = None,
13761377
legend: _bool = False,
13771378
**kwargs: Any,

0 commit comments

Comments
 (0)