klein icon indicating copy to clipboard operation
klein copied to clipboard

Fix typing for async route methods

Open wsanchez opened this issue 2 years ago • 0 comments

Add some async methods to typing_app.py to verify that those work… and they do not:

src/klein/test/typing_app.py:87:6: error: Value of type variable "KleinRouteHandlerT" of function cannot be
"Callable[[Application, IRequest], Coroutine[Any, Any, Union[Union[Union[str, bytes, IResource, IRenderable, Tag, None], Iterable[Union[str, bytes, IResource, IRenderable, Tag, None]]], Awaitable[Union[Union[str, bytes, IResource, IRenderable, Tag, None], Iterable[Union[str, bytes, IResource, IRenderable, Tag, None]]]]]]]"
 [type-var]

These errors are a bit tough to read… I gave it a stab but I'm not sure why this is unhappy.

wsanchez avatar May 24 '23 00:05 wsanchez