Return annotation of response.json()
#1666
Unanswered
jonathanslenders
asked this question in
Ideas
Replies: 1 comment
-
|
We'd want Switching to that would probably be okay. It's not complete (because we're not fully expressing the types of dict and list*), but it is sufficient to catch this kind of error. * Note that Python can't fully express the type that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, the function signature of
response.json()returnsAny.The issue with this is that mypy won't complain when we write:
The result is not awaitable. This is common however, when migrating from other HTTP clients like aiohttp.
Ideally, I'd like the return type to be something like this:
I'm not sure whether that's actually feasible.
Beta Was this translation helpful? Give feedback.
All reactions