From 52974e0a2bd9611088456d56b1f62590d161b2bf Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 4 Oct 2020 03:53:02 -0700 Subject: [PATCH] asyncio.Semaphore: type some internals (#4605) Co-authored-by: hauntsaninja <> --- stdlib/3/asyncio/locks.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/3/asyncio/locks.pyi b/stdlib/3/asyncio/locks.pyi index 040b2c37e..7480c3394 100644 --- a/stdlib/3/asyncio/locks.pyi +++ b/stdlib/3/asyncio/locks.pyi @@ -1,8 +1,9 @@ import sys from types import TracebackType -from typing import Any, Awaitable, Callable, Generator, Optional, Type, TypeVar, Union +from typing import Any, Awaitable, Callable, Deque, Generator, Optional, Type, TypeVar, Union from .events import AbstractEventLoop +from .futures import Future _T = TypeVar("_T") @@ -55,10 +56,13 @@ class Condition(_ContextManagerMixin): def notify_all(self) -> None: ... class Semaphore(_ContextManagerMixin): + _value: int + _waiters: Deque[Future[Any]] def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> bool: ... def release(self) -> None: ... + def _wake_up_next(self) -> None: ... class BoundedSemaphore(Semaphore): def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ...