mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Fix several methods that should be async def, but aren't (#7107)
This commit is contained in:
@@ -85,7 +85,7 @@ class closing(AbstractContextManager[_SupportsCloseT]):
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class _SupportsAclose(Protocol):
|
||||
def aclose(self) -> Awaitable[object]: ...
|
||||
async def aclose(self) -> object: ...
|
||||
_SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose)
|
||||
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
|
||||
@@ -122,7 +122,7 @@ if sys.version_info >= (3, 7):
|
||||
class AsyncExitStack(AbstractAsyncContextManager[AsyncExitStack]):
|
||||
def __init__(self) -> None: ...
|
||||
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> Awaitable[_T]: ...
|
||||
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> _T: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
|
||||
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
@@ -130,11 +130,11 @@ if sys.version_info >= (3, 7):
|
||||
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
|
||||
) -> Callable[_P, Awaitable[_T]]: ...
|
||||
def pop_all(self: Self) -> Self: ...
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
def __aenter__(self: Self) -> Awaitable[Self]: ...
|
||||
def __aexit__(
|
||||
async def aclose(self) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> Awaitable[bool]: ...
|
||||
) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]):
|
||||
|
||||
Reference in New Issue
Block a user