mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
sqlalchemy: Annotate (Async)Session.__(a)enter__ (#7488)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from typing import Any
|
||||
|
||||
from ...util import memoized_property
|
||||
@@ -50,7 +51,7 @@ class AsyncSession(ReversibleProxy):
|
||||
async def close(self): ...
|
||||
@classmethod
|
||||
async def close_all(cls): ...
|
||||
async def __aenter__(self): ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, type_, value, traceback) -> None: ...
|
||||
# proxied from Session
|
||||
identity_map: Any
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, overload
|
||||
|
||||
@@ -104,7 +105,7 @@ class Session(_SessionClassMethods):
|
||||
query_cls: Any | None = ...,
|
||||
) -> None: ...
|
||||
connection_callable: Any
|
||||
def __enter__(self): ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, type_, value, traceback) -> None: ...
|
||||
@property
|
||||
def transaction(self): ...
|
||||
|
||||
Reference in New Issue
Block a user