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
Closed

Conversation

Lynsoo
Copy link

@Lynsoo Lynsoo commented Apr 25, 2025

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

@Lynsoo
Copy link
Author

Lynsoo commented Apr 25, 2025

pre-commit.ci autofix

Comment on lines 210 to 212
func: Callable[..., Optional[Iterable[Artist]]],
frames: Iterable | int | Callable[[], Generator] | None = ...,
init_func: Optional[Callable[[], Optional[Iterable[Artist]]]] = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use just | None like the others, no need for Optional.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you I didn't know that.

@Lynsoo
Copy link
Author

Lynsoo commented Apr 26, 2025

pre-commit.ci autofix

@tacaswell
Copy link
Member

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).

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@QuLogic
Copy link
Member

QuLogic commented Apr 28, 2025

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).

It's a GitHub App, with a mix of some read and some write permissions. You can find it in Settings->GitHub Apps.

@timhoffm
Copy link
Member

Let's not solve this by overload, as discussed here #29960 (comment). A simpler fix is #29984.

@Lynsoo anyway thanks for the contribution!

@timhoffm timhoffm closed this Apr 29, 2025
@Lynsoo Lynsoo deleted the fix-FuncAnimation-class branch April 30, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: FuncAnimation function not typed properly
5 participants