|
14 | 14 | Event = typing.Union[asyncio.Event, trio.Event] |
15 | 15 |
|
16 | 16 |
|
17 | | -_Message = typing.Dict[str, typing.Any] |
| 17 | +_Message = typing.MutableMapping[str, typing.Any] |
18 | 18 | _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]] |
22 | 20 | _ASGIApp = typing.Callable[ |
23 | 21 | [typing.Dict[str, typing.Any], _Receive, _Send], typing.Coroutine[None, None, None] |
24 | 22 | ] |
@@ -137,7 +135,7 @@ async def receive() -> typing.Dict[str, typing.Any]: |
137 | 135 | return {"type": "http.request", "body": b"", "more_body": False} |
138 | 136 | return {"type": "http.request", "body": body, "more_body": True} |
139 | 137 |
|
140 | | - async def send(message: typing.Dict[str, typing.Any]) -> None: |
| 138 | + async def send(message: _Message) -> None: |
141 | 139 | nonlocal status_code, response_headers, response_started |
142 | 140 |
|
143 | 141 | if message["type"] == "http.response.start": |
|
0 commit comments