asyncio.Semaphore: type some internals (#4605)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-10-04 03:53:02 -07:00
committed by GitHub
parent 7afc733054
commit 52974e0a2b

View File

@@ -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: ...