]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix inferred type of async_sessionmaker
authorSam Bull <aa6bs0@sambull.org>
Sat, 19 Nov 2022 14:54:02 +0000 (14:54 +0000)
committerGitHub <noreply@github.com>
Sat, 19 Nov 2022 14:54:02 +0000 (14:54 +0000)
lib/sqlalchemy/ext/asyncio/session.py

index 1956ea588ade60ff42c405b6b81adc65faa253e0..6849d258e04166a31804825f1caed1f1355e90f5 100644 (file)
@@ -1436,6 +1436,40 @@ class async_sessionmaker(Generic[_AS]):
 
     class_: Type[_AS]
 
+    @overload
+    def __init__(
+        self: async_sessionmaker[AsyncSession],
+        bind: Optional[_AsyncSessionBind] = None,
+        *,
+        autoflush: bool = True,
+        expire_on_commit: bool = True,
+        info: Optional[_InfoType] = None,
+        **kw: Any,
+    ):
+        ...
+    @overload
+    def __init__(
+        self,
+        bind: Optional[_AsyncSessionBind],
+        class_: Type[_AS],  # type: ignore
+        autoflush: bool = True,
+        expire_on_commit: bool = True,
+        info: Optional[_InfoType] = None,
+        **kw: Any,
+    ):
+        ...
+    @overload
+    def __init__(
+        self,
+        bind: Optional[_AsyncSessionBind] = ...,
+        *,
+        class_: Type[_AS],  # type: ignore
+        autoflush: bool = True,
+        expire_on_commit: bool = True,
+        info: Optional[_InfoType] = None,
+        **kw: Any,
+    ):
+        ...
     def __init__(
         self,
         bind: Optional[_AsyncSessionBind] = None,