You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this is that mypy doesn't consider partial to be a subtype of Callable, even though it obviously should be. This is a bug in mypy, and there already is an open issue for this: #797
The 2.7 stub for functools contains this elaborate definition for
functools.partial
:However, despite the presence of a
__call__
method, this isn't compatible with Callable -- e.g. this gives an error:The error is on the last line:
I can shut it up with a cast but that's ugly. I'd like the checker to at least understand that class partial as given is callable.
The text was updated successfully, but these errors were encountered: