Fix various py310 stubtest errors (#7239)

This commit is contained in:
Alex Waygood
2022-02-16 19:47:49 +00:00
committed by GitHub
parent fef3a71459
commit 5a8b9dafb3
8 changed files with 69 additions and 31 deletions

View File

@@ -1,13 +1,24 @@
import sys
from typing import Any, Callable, NamedTuple
__all__ = ["scheduler"]
class Event(NamedTuple):
time: float
priority: Any
action: Callable[..., Any]
argument: tuple[Any, ...]
kwargs: dict[str, Any]
if sys.version_info >= (3, 10):
class Event(NamedTuple):
time: float
priority: Any
sequence: int
action: Callable[..., Any]
argument: tuple[Any, ...]
kwargs: dict[str, Any]
else:
class Event(NamedTuple):
time: float
priority: Any
action: Callable[..., Any]
argument: tuple[Any, ...]
kwargs: dict[str, Any]
class scheduler:
timefunc: Callable[[], float]