Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 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 Optional, 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]],
func: Callable[..., Optional[Iterable[Artist]]],
frames: Iterable | int | Callable[[], Generator] | None = ...,
init_func: Optional[Callable[[], Optional[Iterable[Artist]]]] = ...,
fargs: tuple[Any, ...] | None = ...,
save_count: int | None = ...,
*,
blit: Literal[False] = False,
cache_frame_data: bool = ...,
**kwargs
) -> None: ...

@overload
def __init__(
self,
fig: Figure,
func: Callable[..., Iterable[Artist]], # must return Iterable[Artist]
frames: Iterable | int | Callable[[], Generator] | None = ...,
init_func: Callable[[], Iterable[Artist]] | None = ...,
fargs: tuple[Any, ...] | None = ...,
save_count: int | None = ...,
*,
blit: Literal[True],
cache_frame_data: bool = ...,
**kwargs
) -> None: ...
Loading