Incorrect typing for Scope and Message in ASGIApp #2059
Replies: 1 comment
-
It was converted from issue by mistake, the discussion already exists: #2040 |
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
-
According to ASGI spec both scope and event message must be dictionaries, not an arbitrary mutable mapping:
and in other place:
But in starlette they are declared as
MutableMapping
:This actually breaks interoperability with other libraries that follows the spec. For example, the following code
gives the following error when type-checked with mypy:
The typing of ASGI app in httpx follows the spec:
Beta Was this translation helpful? Give feedback.
All reactions