Skip to content

Commit 9514ab0

Browse files
committed
try using Protocol
1 parent 2a0d375 commit 9514ab0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas-stubs/io/formats/style.pyi

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from collections.abc import (
55
from typing import (
66
Any,
77
Literal,
8+
Protocol,
89
overload,
910
)
1011

@@ -40,6 +41,9 @@ from pandas.io.formats.style_render import (
4041
Subset,
4142
)
4243

44+
class SeriesFunc(Protocol):
45+
def __call__(self, series: Series, *args: Any, **kwargs: Any) -> list | Series: ...
46+
4347
class Styler(StylerRenderer):
4448
def __init__(
4549
self,
@@ -198,7 +202,7 @@ class Styler(StylerRenderer):
198202
@overload
199203
def apply(
200204
self,
201-
func: Callable[[Series], list | Series],
205+
func: SeriesFunc,
202206
axis: Axis = ...,
203207
subset: Subset | None = ...,
204208
**kwargs: Any,

0 commit comments

Comments
 (0)