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

Skip to content

FIX: Typing of FuncAnimation #29984

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1769,8 +1769,8 @@
self._drawn_artists = self._init_func()
if self._blit:
if self._drawn_artists is None:
raise RuntimeError('The init_func must return a '
'sequence of Artist objects.')
raise RuntimeError('When blit=True, the init_func must '

Check warning on line 1772 in lib/matplotlib/animation.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/animation.py#L1772

Added line #L1772 was not covered by tests
'return a sequence of Artist objects.')
for a in self._drawn_artists:
a.set_animated(self._blit)
self._save_seq = []
Expand All @@ -1787,8 +1787,8 @@

if self._blit:

err = RuntimeError('The animation function must return a sequence '
'of Artist objects.')
err = RuntimeError('When blit=True, the animation function must '
'return a sequence of Artist objects.')
try:
# check if a sequence
iter(self._drawn_artists)
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/animation.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ class FuncAnimation(TimedAnimation):
def __init__(
self,
fig: Figure,
func: Callable[..., Iterable[Artist]],
func: Callable[..., Iterable[Artist] | None],
frames: Iterable | int | Callable[[], Generator] | None = ...,
init_func: Callable[[], Iterable[Artist]] | None = ...,
init_func: Callable[[], Iterable[Artist] | None] | None = ...,
fargs: tuple[Any, ...] | None = ...,
save_count: int | None = ...,
*,
Expand Down
Loading