Files
typeshed/stdlib/sched.pyi
Akuli 17dcea4a68 Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-05-15 15:33:39 +03:00

33 lines
981 B
Python

from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple
class Event(NamedTuple):
time: float
priority: Any
action: Callable[..., Any]
argument: Tuple[Any, ...]
kwargs: Dict[Text, Any]
class scheduler:
def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ...
def enterabs(
self,
time: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def enter(
self,
delay: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def run(self, blocking: bool = ...) -> Optional[float]: ...
def cancel(self, event: Event) -> None: ...
def empty(self) -> bool: ...
@property
def queue(self) -> List[Event]: ...