mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
stdlib: Add several missing @abstractmethod decorators (#7443)
This commit is contained in:
@@ -137,6 +137,9 @@ elif sys.version_info >= (3, 7):
|
||||
func: Callable[..., AsyncGenerator[_T_co, Any]]
|
||||
args: tuple[Any, ...]
|
||||
kwds: dict[str, Any]
|
||||
async def __aexit__(
|
||||
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T_co]]) -> Callable[_P, _AsyncGeneratorContextManager[_T_co]]: ...
|
||||
@@ -148,6 +151,7 @@ _SupportsCloseT = TypeVar("_SupportsCloseT", bound=_SupportsClose)
|
||||
|
||||
class closing(AbstractContextManager[_SupportsCloseT]):
|
||||
def __init__(self, thing: _SupportsCloseT) -> None: ...
|
||||
def __exit__(self, *exc_info: object) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class _SupportsAclose(Protocol):
|
||||
@@ -156,6 +160,7 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
|
||||
def __init__(self, thing: _SupportsAcloseT) -> None: ...
|
||||
async def __aexit__(self, *exc_info: object) -> None: ...
|
||||
|
||||
class suppress(AbstractContextManager[None]):
|
||||
def __init__(self, *exceptions: type[BaseException]) -> None: ...
|
||||
@@ -163,11 +168,14 @@ class suppress(AbstractContextManager[None]):
|
||||
self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
|
||||
) -> bool: ...
|
||||
|
||||
class redirect_stdout(AbstractContextManager[_T_io]):
|
||||
class _RedirectStream(AbstractContextManager[_T_io]):
|
||||
def __init__(self, new_target: _T_io) -> None: ...
|
||||
def __exit__(
|
||||
self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class redirect_stderr(AbstractContextManager[_T_io]):
|
||||
def __init__(self, new_target: _T_io) -> None: ...
|
||||
class redirect_stdout(_RedirectStream[_T_io]): ...
|
||||
class redirect_stderr(_RedirectStream[_T_io]): ...
|
||||
|
||||
class ExitStack(AbstractContextManager[ExitStack]):
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user