Skip to content

Commit 1aca764

Browse files
committed
Add type hints for IPython _repr_* helpers
These are semi-public.
1 parent e5e601b commit 1aca764

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

lib/matplotlib/animation.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ class Animation:
183183
embed_frames: bool = ...,
184184
default_mode: str | None = ...,
185185
) -> str: ...
186+
def _repr_html_(self) -> str: ...
186187
def pause(self) -> None: ...
187188
def resume(self) -> None: ...
188189

lib/matplotlib/colors.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class Colormap:
9797
def is_gray(self) -> bool: ...
9898
def resampled(self, lutsize: int) -> Colormap: ...
9999
def reversed(self, name: str | None = ...) -> Colormap: ...
100+
def _repr_html_(self) -> str: ...
101+
def _repr_png_(self) -> bytes: ...
100102
def copy(self) -> Colormap: ...
101103

102104
class LinearSegmentedColormap(Colormap):

lib/matplotlib/figure.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ class Figure(FigureBase):
315315
**kwargs
316316
) -> None: ...
317317
def get_layout_engine(self) -> LayoutEngine | None: ...
318+
def _repr_html_(self) -> str | None: ...
318319
def show(self, warn: bool = ...) -> None: ...
319320
@property # type: ignore[misc]
320321
def axes(self) -> list[Axes]: ... # type: ignore[override]

lib/matplotlib/font_manager.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class FontEntry:
3535
weight: str | int = ...
3636
stretch: str = ...
3737
size: str = ...
38+
def _repr_html_(self) -> str: ...
39+
def _repr_png_(self) -> bytes: ...
3840

3941
def ttfFontProperty(font: ft2font.FT2Font) -> FontEntry: ...
4042
def afmFontProperty(fontpath: str, font: AFM) -> FontEntry: ...

0 commit comments

Comments
 (0)