mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Improve several stubs. (math, _random, time, etc.)
Some of these are derived from mypy/stubs/.
This commit is contained in:
@@ -1,40 +1,18 @@
|
||||
"""Stub file for the 'thread' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
|
||||
from typing import Any, List, Tuple, Dict, GenericType
|
||||
|
||||
LockType = ... # type: lock
|
||||
error = ... # type: object
|
||||
from typing import Callable, Any
|
||||
|
||||
def _count() -> int: ...
|
||||
|
||||
def allocate() -> lock: ...
|
||||
|
||||
def allocate_lock() -> lock: ...
|
||||
|
||||
def exit() -> Any:
|
||||
raise SystemExit()
|
||||
|
||||
def exit_thread() -> Any:
|
||||
raise SystemExit()
|
||||
|
||||
def get_ident() -> int: ...
|
||||
|
||||
def interrupt_main() -> None: ...
|
||||
|
||||
def stack_size(*args, **kwargs) -> int:
|
||||
raise ValueError()
|
||||
|
||||
def start_new(*args, **kwargs) -> int:
|
||||
raise MemoryError()
|
||||
raise TypeError()
|
||||
|
||||
def start_new_thread(*args, **kwargs) -> int:
|
||||
raise MemoryError()
|
||||
raise TypeError()
|
||||
class error(Exception): ...
|
||||
|
||||
class LockType:
|
||||
def acquire(self, waitflag: int = None) -> bool: ...
|
||||
def acquire_lock(self, waitflag: int = None) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def release_lock(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
def locked_lock(self) -> bool: ...
|
||||
def __enter__(self) -> LockType: ...
|
||||
def __exit__(self, value: Any, traceback: Any) -> None: ...
|
||||
|
||||
class _local(object):
|
||||
pass
|
||||
@@ -42,12 +20,13 @@ class _local(object):
|
||||
class _localdummy(object):
|
||||
pass
|
||||
|
||||
class lock(object):
|
||||
def __enter__(*args, **kwargs) -> bool: ...
|
||||
def __exit__(*args, **kwargs) -> None: ...
|
||||
def acquire(*args, **kwargs) -> bool: ...
|
||||
def acquire_lock(*args, **kwargs) -> bool: ...
|
||||
def locked() -> bool: ...
|
||||
def locked_lock() -> bool: ...
|
||||
def release() -> None: ...
|
||||
def release_lock() -> None: ...
|
||||
def start_new(function: Callable[..., Any], args: Any, kwargs: Any = None) -> int: ...
|
||||
def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = None) -> int: ...
|
||||
def interrupt_main() -> None: ...
|
||||
def exit() -> None: ...
|
||||
raise SystemExit()
|
||||
def exit_thread() -> Any:
|
||||
raise SystemExit()
|
||||
def allocate_lock() -> LockType: ...
|
||||
def get_ident() -> int: ...
|
||||
def stack_size(size: int = None) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user