Skip to content

Commit 57b2bae

Browse files
graingertAkuliAlexWaygood
authored
correct asyncio.locks._ContextManagerMixin and _ContextManager types (#7124)
Co-authored-by: Akuli <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
1 parent 4e67419 commit 57b2bae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

stdlib/asyncio/locks.pyi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ _T = TypeVar("_T")
1111

1212
if sys.version_info >= (3, 9):
1313
class _ContextManagerMixin:
14-
def __init__(self, lock: Lock | Semaphore) -> None: ...
1514
async def __aenter__(self) -> None: ...
1615
async def __aexit__(
1716
self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
@@ -20,14 +19,13 @@ if sys.version_info >= (3, 9):
2019
else:
2120
class _ContextManager:
2221
def __init__(self, lock: Lock | Semaphore) -> None: ...
23-
def __enter__(self) -> object: ...
22+
def __enter__(self) -> None: ...
2423
def __exit__(self, *args: Any) -> None: ...
2524

2625
class _ContextManagerMixin:
27-
def __init__(self, lock: Lock | Semaphore) -> None: ...
2826
# Apparently this exists to *prohibit* use as a context manager.
29-
def __enter__(self) -> object: ...
30-
def __exit__(self, *args: Any) -> None: ...
27+
# def __enter__(self) -> NoReturn: ... see: https://github.com/python/typing/issues/1043
28+
# def __exit__(self, *args: Any) -> None: ...
3129
def __iter__(self) -> Generator[Any, None, _ContextManager]: ...
3230
def __await__(self) -> Generator[Any, None, _ContextManager]: ...
3331
async def __aenter__(self) -> None: ...

0 commit comments

Comments
 (0)