mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
add several NamedTuple base classes (#12987)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from typing import Any, NamedTuple
|
||||
from typing import Any, NamedTuple, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["scheduler"]
|
||||
@@ -17,13 +17,16 @@ if sys.version_info >= (3, 10):
|
||||
kwargs: dict[str, Any]
|
||||
|
||||
else:
|
||||
class Event(NamedTuple):
|
||||
@type_check_only
|
||||
class _EventBase(NamedTuple):
|
||||
time: float
|
||||
priority: Any
|
||||
action: _ActionCallback
|
||||
argument: tuple[Any, ...]
|
||||
kwargs: dict[str, Any]
|
||||
|
||||
class Event(_EventBase): ...
|
||||
|
||||
class scheduler:
|
||||
timefunc: Callable[[], float]
|
||||
delayfunc: Callable[[float], object]
|
||||
|
||||
Reference in New Issue
Block a user