mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
most asyncio lock methods always return True (#7122)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user