mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Fix signatures of __init__ for Thread and Timer
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Stubs for threading
|
||||
|
||||
from typing import Any, Dict, Optional, Callable, TypeVar, Union, List, Mapping
|
||||
from typing import Any, Optional, Callable, TypeVar, Union, List, Mapping, Sequence
|
||||
|
||||
def active_count() -> int: ...
|
||||
def activeCount() -> int: ...
|
||||
@@ -14,9 +14,9 @@ class Thread(object):
|
||||
ident = 0
|
||||
daemon = False
|
||||
|
||||
def __init__(self, group: Any = ..., target: Any = ...,
|
||||
name: str = ..., args: tuple = ...,
|
||||
kwargs: Dict[Any, Any] = ...) -> None: ...
|
||||
def __init__(self, group: Any = ..., target: Callable[..., Any] = ...,
|
||||
name: str = ..., args: Sequence[Any] = ...,
|
||||
kwargs: Mapping[str, Any] = ...) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def join(self, timeout: float = ...) -> None: ...
|
||||
@@ -29,12 +29,11 @@ class Thread(object):
|
||||
def isDaemon(self) -> bool: ...
|
||||
def setDaemon(self, daemon: bool) -> None: ...
|
||||
|
||||
class Timer(object):
|
||||
def __init__(self, interval: float, function: Any,
|
||||
args: List[Any] = ...,
|
||||
kwargs: Mapping[Any, Any] = ...) -> None: ...
|
||||
def cancel(self) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
class Timer(Thread):
|
||||
def __init__(self, interval: float, function: Callable[..., Any],
|
||||
args: Sequence[Any] = ...,
|
||||
kwargs: Mapping[str, Any] = ...) -> None: ...
|
||||
def cancel(self) -> None : ...
|
||||
|
||||
# TODO: better type
|
||||
def settrace(func: Callable[[Any, str, Any], Any]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user