most asyncio lock methods always return True (#7122)

This commit is contained in:
Thomas Grainger
2022-02-04 09:18:17 +00:00
committed by GitHub
parent 4d21d5a87d
commit 4e67419b1f

View File

@@ -2,6 +2,7 @@ import sys
from collections import deque
from types import TracebackType
from typing import Any, Callable, Generator, TypeVar
from typing_extensions import Literal
from .events import AbstractEventLoop
from .futures import Future
@@ -37,7 +38,7 @@ else:
class Lock(_ContextManagerMixin):
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...
def release(self) -> None: ...
class Event:
@@ -45,14 +46,14 @@ class Event:
def is_set(self) -> bool: ...
def set(self) -> None: ...
def clear(self) -> None: ...
async def wait(self) -> bool: ...
async def wait(self) -> Literal[True]: ...
class Condition(_ContextManagerMixin):
def __init__(self, lock: Lock | None = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...
def release(self) -> None: ...
async def wait(self) -> bool: ...
async def wait(self) -> Literal[True]: ...
async def wait_for(self, predicate: Callable[[], _T]) -> _T: ...
def notify(self, n: int = ...) -> None: ...
def notify_all(self) -> None: ...
@@ -62,7 +63,7 @@ class Semaphore(_ContextManagerMixin):
_waiters: deque[Future[Any]]
def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...
def release(self) -> None: ...
def _wake_up_next(self) -> None: ...