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
Then mypy complains, because, while I always ensure logically that the proper handler is called with the proper context, it can't see that.
I couldn't find in the documentation a way to tell it that the context type depends on the handler type. I assume it's either a Generic, or a TypeVar, but didn't find the solution.
mypy 0.770
python 3.6
The text was updated successfully, but these errors were encountered:
Thanks. The documentation show many examples with containers, and TypeVar to link the params to the output type. It makes sense you can also use it for Callable, and to link parameters together, but I must say it didn't occur to me.
I have several
TypedDict
:And then related
Callable
:If I then declare a method that depends of both:
Then mypy complains, because, while I always ensure logically that the proper handler is called with the proper context, it can't see that.
I couldn't find in the documentation a way to tell it that the context type depends on the handler type. I assume it's either a Generic, or a TypeVar, but didn't find the solution.
mypy 0.770
python 3.6
The text was updated successfully, but these errors were encountered: