8000 FIX: Typing of FuncAnimation · timhoffm/matplotlib@1bd5b15 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bd5b15

Browse files
committed
FIX: Typing of FuncAnimation
`func` and `init_func` may return None (which is ok if `blit=False`). Since gating the allowed signature on the state of `blit` is not feasible, we err on the side on being too permissive in the type definition: Rather not flag a type error and only raise on runtime than complain on an actually working signature. Closes matplotlib#29960.
1 parent 919d9e9 commit 1bd5b15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/animation.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ class FuncAnimation(TimedAnimation):
206206
def __init__(
207207
self,
208208
fig: Figure,
209-
func: Callable[..., Iterable[Artist]],
209+
func: Callable[..., Iterable[Artist] | None],
210210
frames: Iterable | int | Callable[[], Generator] | None = ...,
211-
init_func: Callable[[], Iterable[Artist]] | None = ...,
211+
init_func: Callable[[], Iterable[Artist] | None] | None = ...,
212212
fargs: tuple[Any, ...] | None = ...,
213213
save_count: int | None = ...,
214214
*,

0 commit comments

Comments
 (0)
0