mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 05:41:11 +08:00
asyncio.Semaphore: type some internals (#4605)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user