Skip to content

Commit ab842b7

Browse files
committed
review typing aliases in asgi.py
1 parent 9e8ab40 commit ab842b7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

httpx/_transports/asgi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
_Message = typing.MutableMapping[str, typing.Any]
1818
_Receive = typing.Callable[[], typing.Awaitable[_Message]]
19-
_Send = typing.Callable[
20-
[typing.MutableMapping[str, typing.Any]], typing.Awaitable[None]
21-
]
19+
_Send = typing.Callable[[_Message], typing.Awaitable[None]]
2220
_ASGIApp = typing.Callable[
2321
[typing.MutableMapping[str, typing.Any], _Receive, _Send], typing.Awaitable[None]
2422
]
@@ -131,7 +129,7 @@ async def handle_async_request(
131129

132130
# ASGI callables.
133131

134-
async def receive() -> dict[str, typing.Any]:
132+
async def receive() -> _Message:
135133
nonlocal request_complete
136134

137135
if request_complete:
@@ -145,7 +143,7 @@ async def receive() -> dict[str, typing.Any]:
145143
return {"type": "http.request", "body": b"", "more_body": False}
146144
return {"type": "http.request", "body": body, "more_body": True}
147145

148-
async def send(message: typing.MutableMapping[str, typing.Any]) -> None:
146+
async def send(message: _Message) -> None:
149147
nonlocal status_code, response_headers, response_started
150148

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

0 commit comments

Comments
 (0)