Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit be45c13

Browse files
Typing: loose _Message from dict to MutableMapping
Resolves encode#2832
1 parent 88e8431 commit be45c13

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

httpx/_transports/asgi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
Event = typing.Union[asyncio.Event, trio.Event]
1515

1616

17-
_Message = typing.Dict[str, typing.Any]
17+
_Message = typing.MutableMapping[str, typing.Any]
1818
_Receive = typing.Callable[[], typing.Awaitable[_Message]]
19-
_Send = typing.Callable[
20-
[typing.Dict[str, typing.Any]], typing.Coroutine[None, None, None]
21-
]
19+
_Send = typing.Callable[[_Message], typing.Coroutine[None, None, None]]
2220
_ASGIApp = typing.Callable[
2321
[typing.Dict[str, typing.Any], _Receive, _Send], typing.Coroutine[None, None, None]
2422
]
@@ -137,7 +135,7 @@ async def receive() -> typing.Dict[str, typing.Any]:
137135
return {"type": "http.request", "body": b"", "more_body": False}
138136
return {"type": "http.request", "body": body, "more_body": True}
139137

140-
async def send(message: typing.Dict[str, typing.Any]) -> None:
138+
async def send(message: _Message) -> None:
141139
nonlocal status_code, response_headers, response_started
142140

143141
if message["type"] == "http.response.start":

0 commit comments

Comments
 (0)