Skip to content
25 changes: 21 additions & 4 deletions lib/matplotlib/animation.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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: ...
Loading