diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index ec959e89b..ea5c17ff7 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -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: ...