]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
Fix `Lifespan State` docs typing import (#2236)
authorBartosz Magiera <28759224+bartosz121@users.noreply.github.com>
Fri, 25 Aug 2023 19:00:30 +0000 (21:00 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 19:00:30 +0000 (19:00 +0000)
docs/lifespan.md

index 88c49c0644f2cb22586ee5acc8ce764cbd2d6e6e..a5a766251bdf6c31bd4dfc94a5b4f3099d528d17 100644 (file)
@@ -39,7 +39,7 @@ can be used to share the objects between the lifespan, and the requests.
 
 ```python
 import contextlib
-from typing import TypedDict
+from typing import AsyncIterator, TypedDict
 
 import httpx
 from starlette.applications import Starlette
@@ -53,7 +53,7 @@ class State(TypedDict):
 
 
 @contextlib.asynccontextmanager
-async def lifespan(app: Starlette) -> typing.AsyncIterator[State]:
+async def lifespan(app: Starlette) -> AsyncIterator[State]:
     async with httpx.AsyncClient() as client:
         yield {"http_client": client}