Skip to content

Commit 9e075a4

Browse files
committed
ENH: Improve Styler
1 parent 74ac551 commit 9e075a4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pandas-stubs/io/formats/style.pyi

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from typing import (
33
Callable,
44
Hashable,
55
Sequence,
6+
TypeVar,
67
)
78

89
from pandas.core.frame import DataFrame
@@ -25,6 +26,8 @@ from pandas.io.formats.style_render import (
2526
Subset,
2627
)
2728

29+
_StylerT = TypeVar("_StylerT", bound=Styler)
30+
2831
class Styler(StylerRenderer):
2932
def __init__(
3033
self,
@@ -252,8 +255,13 @@ class Styler(StylerRenderer):
252255
@classmethod
253256
def from_custom_template(
254257
cls,
255-
searchpath,
258+
searchpath: str | list[str],
256259
html_table: str | None = ...,
257260
html_style: str | None = ...,
258-
): ...
259-
def pipe(self, func: Callable, *args, **kwargs): ...
261+
) -> _StylerT: ...
262+
def pipe(
263+
self,
264+
func: Callable[[Styler], Styler] | tuple[Callable[[Styler], Styler], str],
265+
*args: Any,
266+
**kwargs: Any,
267+
) -> Styler: ...

0 commit comments

Comments
 (0)