FIX: Typing of FuncAnimation#29984
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 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.
1bd5b15 to
db0ec14
Compare
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. |
funcandinit_funcmay return None (which is ok ifblit=False). Since gating the allowed signature on the state ofblitis 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.