mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Fix signatures of __init__ for Thread and Timer
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any, Dict, Optional, Callable, TypeVar, Union
|
||||
from typing import Any, Optional, Callable, TypeVar, Union, Mapping, Sequence
|
||||
|
||||
class Thread:
|
||||
name = ... # type: str
|
||||
ident = 0
|
||||
daemon = False
|
||||
|
||||
def __init__(self, group: Any = ..., target: Any = ..., args: Any = ...,
|
||||
kwargs: Dict[Any, Any] = ...,
|
||||
verbose: Any = ...) -> None: ...
|
||||
def __init__(self, group: Any = ..., target: Callable[..., Any] = ...,
|
||||
name: str = ..., args: Sequence[Any] = ...,
|
||||
kwargs: Mapping[str, Any] = ..., daemon: bool = ...) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def join(self, timeout: float = ...) -> None: ...
|
||||
@@ -23,6 +23,12 @@ class Thread:
|
||||
def isDaemon(self) -> bool: ...
|
||||
def setDaemon(self, daemon: bool) -> None: ...
|
||||
|
||||
class Timer(Thread):
|
||||
def __init__(self, interval: float, function: Callable[..., Any],
|
||||
args: Sequence[Any] = ...,
|
||||
kwargs: Mapping[str, Any] = ...) -> None: ...
|
||||
def cancel(self) -> None : ...
|
||||
|
||||
class Event:
|
||||
def is_set(self) -> bool: ...
|
||||
def set(self) -> None: ...
|
||||
@@ -54,8 +60,3 @@ class Condition:
|
||||
def wait_for(self, predicate: Callable[[], _T], timeout: float = ...) -> Union[_T, bool]: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class Timer(Thread):
|
||||
def __init__(self, interval: float, function: Callable[..., Any],
|
||||
args: Any = ..., kwargs: Dict[Any, Any] = ...) -> None: ...
|
||||
def cancel(self) -> None : ...
|
||||
|
||||
Reference in New Issue
Block a user