decorators cannot get type hints for async function return values #1284
-
|
I use a decorator to get the return value type of a synchronous function, it's ok. this code: but,I can't get the return value type hint of an async function using a decorator. this code: |
Beta Was this translation helpful? Give feedback.
Answered by
JelleZijlstra
Nov 5, 2022
Replies: 1 comment 1 reply
-
|
This is because |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mkdir700
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


This is because
async_decis missing a return type. If I add a return type (Callable[[Callable[P, Awaitable[T]]], Callable[P, Awaitable[T]]]), both mypy and pyright correctly infer thatris anint.