mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
correct asyncio.locks._ContextManagerMixin and _ContextManager types (#7124)
Co-authored-by: Akuli <akuviljanen17@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -11,7 +11,6 @@ _T = TypeVar("_T")
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
class _ContextManagerMixin:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
async def __aenter__(self) -> None: ...
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
|
||||
@@ -20,14 +19,13 @@ if sys.version_info >= (3, 9):
|
||||
else:
|
||||
class _ContextManager:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
def __enter__(self) -> object: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
|
||||
class _ContextManagerMixin:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
# Apparently this exists to *prohibit* use as a context manager.
|
||||
def __enter__(self) -> object: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
# def __enter__(self) -> NoReturn: ... see: https://github.com/python/typing/issues/1043
|
||||
# def __exit__(self, *args: Any) -> None: ...
|
||||
def __iter__(self) -> Generator[Any, None, _ContextManager]: ...
|
||||
def __await__(self) -> Generator[Any, None, _ContextManager]: ...
|
||||
async def __aenter__(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user