Conversation
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
lib/matplotlib/animation.pyi
Outdated
| func: Callable[..., Optional[Iterable[Artist]]], | ||
| frames: Iterable | int | Callable[[], Generator] | None = ..., | ||
| init_func: Optional[Callable[[], Optional[Iterable[Artist]]]] = ..., |
There was a problem hiding this comment.
You can use just | None like the others, no need for Optional.
There was a problem hiding this comment.
I see, thank you I didn't know that.
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Who's credentials is precommit using to push these commits? If they are the orgs we should turn that off as a security risk (if they are the users I am still worried, but I don't think there is anything we can/should do about it). |
tacaswell
left a comment
There was a problem hiding this comment.
Please do not merge until the discussion in the linked issue is resolved.
I do not think we should relax the typing in this way.
It's a GitHub App, with a mix of some read and some write permissions. You can find it in Settings->GitHub Apps. |
|
Let's not solve this by overload, as discussed here #29960 (comment). A simpler fix is #29984. @Lynsoo anyway thanks for the contribution! |
PR summary
Why is this change necessary?
To ensure the update function passed to FuncAnimation matches expected signatures and avoids runtime errors.
What problem does it solve?
It prevents type errors and ensures the animation updates frames correctly without freezing or crashing.
What is the reasoning for this implementation?
FuncAnimation requires different update function return types depending on blit, typing must reflect this to satisfy static checkers and runtime behavior.
Closes #29960
pre-commit.ci autofix
PR checklist