Thanks. I think the Union there is slightly wrong in a couple ways:
f is not an Awaitable itself but a function that returns a value, possibly in some kind of async container.
If the Union moves inside like Callable[_P, Union[Awaitable[_T], _T]] then the return type expresses nothing more than Callable[_P, _T] because _T includes all of Awaitable[_T] (ie, _T might be Awaitable[_S]).
So unfortunately the best type I can figure out for f is Callable[_P, _T] even though this clearly fails to capture a lot of interesting stuff about the type.
The handling of the parameters of
kwargsis overly general. The handling of
_Tis incomplete and incorrect with respect to
executeis in roughly the same situation.
The text was updated successfully, but these errors were encountered: