Skip to content

Commit 794d8bc

Browse files
committed
type
1 parent 3fa4f7b commit 794d8bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fastsqla.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import math
22
import os
33
from collections.abc import AsyncGenerator, Awaitable, Callable, Iterable
4-
from contextlib import asynccontextmanager
4+
from contextlib import _AsyncGeneratorContextManager, asynccontextmanager
55
from typing import Annotated, Generic, TypeVar, TypedDict
66

77
from fastapi import Depends, FastAPI, Query
@@ -78,7 +78,9 @@ class State(TypedDict):
7878
fastsqla_engine: AsyncEngine
7979

8080

81-
def new_lifespan(url: str | None = None, **kw):
81+
def new_lifespan(
82+
url: str | None = None, **kw
83+
) -> Callable[[FastAPI], _AsyncGeneratorContextManager[State, None]]:
8284
"""Create a new lifespan async context manager.
8385
8486
It expects the exact same parameters as

0 commit comments

Comments
 (0)