diff --git a/lib/matplotlib/animation.pyi b/lib/matplotlib/animation.pyi index 345e3c6dbe61..36966e186a05 100644 --- a/lib/matplotlib/animation.pyi +++ b/lib/matplotlib/animation.pyi @@ -6,7 +6,7 @@ from matplotlib.artist import Artist from matplotlib.backend_bases import TimerBase from matplotlib.figure import Figure -from typing import Any +from typing import Tuple, Literal, overload, Any subprocess_creation_flags: int @@ -203,15 +203,32 @@ class ArtistAnimation(TimedAnimation): def __init__(self, fig: Figure, artists: Sequence[Collection[Artist]], *args, **kwargs) -> None: ... class FuncAnimation(TimedAnimation): + @overload + def __init__( + self, + fig: Figure, + func: Callable[..., Iterable[Artist] | None], + frames: Iterable | int | Callable[[], Generator] | None = ..., + init_func: Callable[[], Iterable[Artist] | None] | None = ..., + fargs: Tuple[Any, ...] | None = ..., + save_count: int | None = ..., + *, + blit: Literal[False] = False, + cache_frame_data: bool = ..., + **kwargs: Any + ) -> None: ... + + @overload def __init__( self, fig: Figure, func: Callable[..., Iterable[Artist]], frames: Iterable | int | Callable[[], Generator] | None = ..., - init_func: Callable[[], Iterable[Artist]] | None = ..., - fargs: tuple[Any, ...] | None = ..., + init_func: Callable[[], Iterable[Artist] | None] | None = ..., + fargs: Tuple[Any, ...] | None = ..., save_count: int | None = ..., *, + blit: Literal[True], cache_frame_data: bool = ..., - **kwargs + **kwargs: Any ) -> None: ...