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
You can't actually use Callable as a base class. If you don't get an error on that, you're probably not using mypy but just getting whatever errors PyCharm produces on its own (it has a sophisticated type inference engine, it just works different than mypy).
This tracker is not about mypy. It is about runtime issues in the backport of typing to older versions of Python.
Anyway, this error is correct, because just by inheriting from Callable you don't make a class callable, you must implement the __call__() method. Also mypy shows Invalid base class for this code, see python/mypy#4031.
I have a bunch of types defined like this:
Then I'm using a function typed with
OperationCallable
elsewhere, like this:This is throwing a mypy (I assume, I'm using PyCharm) error:
Am I missing something? Is there a different way to go about this?
Thanks!
The text was updated successfully, but these errors were encountered: