mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -14,12 +14,12 @@ class Thread(object):
|
||||
ident = 0
|
||||
daemon = False
|
||||
|
||||
def __init__(self, group: Any = None, target: Any = None,
|
||||
name: str = None, args: tuple = (),
|
||||
kwargs: Dict[Any, Any] = {}) -> None: ...
|
||||
def __init__(self, group: Any = ..., target: Any = ...,
|
||||
name: str = ..., args: tuple = ...,
|
||||
kwargs: Dict[Any, Any] = ...) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def join(self, timeout: float = None) -> None: ...
|
||||
def join(self, timeout: float = ...) -> None: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
|
||||
# Legacy methods
|
||||
@@ -31,15 +31,15 @@ class Thread(object):
|
||||
|
||||
class Timer(object):
|
||||
def __init__(self, interval: float, function: Any,
|
||||
args: List[Any] = [],
|
||||
kwargs: Mapping[Any, Any] = {}) -> None: ...
|
||||
args: List[Any] = ...,
|
||||
kwargs: Mapping[Any, Any] = ...) -> None: ...
|
||||
def cancel(self) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
|
||||
# TODO: better type
|
||||
def settrace(func: Callable[[Any, str, Any], Any]) -> None: ...
|
||||
def setprofile(func: Any) -> None: ...
|
||||
def stack_size(size: int = 0) -> None: ...
|
||||
def stack_size(size: int = ...) -> None: ...
|
||||
|
||||
class ThreadError(Exception):
|
||||
pass
|
||||
@@ -54,45 +54,45 @@ class Event(object):
|
||||
def set(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
# TODO can it return None?
|
||||
def wait(self, timeout: float = None) -> bool: ...
|
||||
def wait(self, timeout: float = ...) -> bool: ...
|
||||
|
||||
class Lock(object):
|
||||
def acquire(self, blocking: bool = True) -> bool: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class RLock(object):
|
||||
def acquire(self, blocking: int = 1) -> Optional[bool]: ...
|
||||
def acquire(self, blocking: int = ...) -> Optional[bool]: ...
|
||||
def release(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class Semaphore(object):
|
||||
def acquire(self, blocking: bool = True) -> Optional[bool]: ...
|
||||
def acquire(self, blocking: bool = ...) -> Optional[bool]: ...
|
||||
def release(self) -> None: ...
|
||||
def __init__(self, value: int = 1) -> None: ...
|
||||
def __init__(self, value: int = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class BoundedSemaphore(object):
|
||||
def acquire(self, blocking: bool = True) -> Optional[bool]: ...
|
||||
def acquire(self, blocking: bool = ...) -> Optional[bool]: ...
|
||||
def release(self) -> None: ...
|
||||
def __init__(self, value: int = 1) -> None: ...
|
||||
def __init__(self, value: int = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Condition(object):
|
||||
def acquire(self, blocking: bool = True) -> bool: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def notify(self, n: int = 1) -> None: ...
|
||||
def notify(self, n: int = ...) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
def notifyAll(self) -> None: ...
|
||||
def wait(self, timeout: float = None) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], _T], timeout: float = None) -> Union[_T, bool]: ...
|
||||
def wait(self, timeout: float = ...) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], _T], timeout: float = ...) -> Union[_T, bool]: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
def __init__(self, lock: Lock = None) -> None: ...
|
||||
def __init__(self, lock: Lock = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user