mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Stubs for sched (#1204)
* stubs for sched * can't use NamedTuple classes
This commit is contained in:
committed by
Łukasz Langa
parent
5a20d41d4a
commit
0fcece539b
29
stdlib/2and3/sched.pyi
Normal file
29
stdlib/2and3/sched.pyi
Normal file
@@ -0,0 +1,29 @@
|
||||
# Stub for sched (Python 2 and 3)
|
||||
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, List, NamedTuple, Text, Tuple
|
||||
|
||||
Event = NamedTuple('Event', [
|
||||
('time', float),
|
||||
('priority', Any),
|
||||
('action', Callable[..., Any]),
|
||||
('argument', Tuple[Any, ...]),
|
||||
('kwargs', Dict[Text, Any]),
|
||||
])
|
||||
|
||||
class scheduler:
|
||||
if sys.version_info >= (3, 3):
|
||||
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 = ...) -> float: ...
|
||||
else:
|
||||
def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ...
|
||||
def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ...
|
||||
def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ...
|
||||
def run(self) -> float: ...
|
||||
|
||||
def cancel(self, event: Event) -> None: ...
|
||||
def empty(self) -> bool: ...
|
||||
@property
|
||||
def queue(self) -> List[Event]: ...
|
||||
Reference in New Issue
Block a user