Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
asyncio.Semaphore: type some internals (python#4605)
Browse files Browse the repository at this point in the history
Co-authored-by: hauntsaninja <>
  • Loading branch information
hauntsaninja authored Oct 4, 2020
1 parent 7afc733 commit 52974e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion stdlib/3/asyncio/locks.pyi
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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: ...

0 comments on commit 52974e0

Please sign in to comment.