stdlib: Add several missing @abstractmethod decorators (#7443)

This commit is contained in:
Alex Waygood
2022-03-07 00:41:13 +00:00
committed by GitHub
parent 2fb9c35ff9
commit 947724a5cb
7 changed files with 29 additions and 4 deletions

View File

@@ -902,6 +902,7 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
@runtime_checkable
class ContextManager(Protocol[_T_co]):
def __enter__(self) -> _T_co: ...
@abstractmethod
def __exit__(
self, __exc_type: Type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
) -> bool | None: ...
@@ -909,6 +910,7 @@ class ContextManager(Protocol[_T_co]):
@runtime_checkable
class AsyncContextManager(Protocol[_T_co]):
async def __aenter__(self) -> _T_co: ...
@abstractmethod
async def __aexit__(
self, __exc_type: Type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
) -> bool | None: ...