Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix FuncAnimation class #29968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
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