Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
`func` and `init_func` may return None (which is ok if `blit=False`).Since gating the allowed signature on the state of `blit` is notfeasible, we err on the side on being too permissive in the typedefinition: Rather not flag a type error and only raise on runtime thancomplain on an actually working signature.Closesmatplotlib#29960.
2c5e469
intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
Sorry but I do not understand. Wasn't that exactly what#29967 was trying to do? |
Yes, but it's only a partial solution. See#29960 (comment) |
The solution to that is to have two overloads: one for |
You are right, one could do this. However, I'm not convinced it's worth the added complexity. My personal take on type hints is:
In this case, I think the complexity of the overload is not worth it, at least not as long as there are no simpler specifications of overloads. |
func
andinit_func
may return None (which is ok ifblit=False
). Since gating the allowed signature on the state ofblit
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#29960.