Improve several stubs. (math, _random, time, etc.)

Some of these are derived from mypy/stubs/.
This commit is contained in:
Matthias Kramm
2015-09-15 13:51:11 -07:00
parent 42afca768b
commit dd042b3255
10 changed files with 538 additions and 576 deletions

View File

@@ -1,15 +1,11 @@
"""Stub file for the 'signal' 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 Callable, Any, Tuple, Union
from typing import Any, List, Tuple, Dict, GenericType
ITIMER_PROF = ... # type: long
SIG_DFL = ... # type: long
SIG_IGN = ... # type: long
ITIMER_REAL = ... # type: long
ITIMER_VIRTUAL = ... # type: long
ItimerError = ... # type: object
NSIG = ... # type: int
ITIMER_PROF = ... # type: long
SIGABRT = ... # type: int
SIGALRM = ... # type: int
SIGBUS = ... # type: int
@@ -45,31 +41,26 @@ SIGVTALRM = ... # type: int
SIGWINCH = ... # type: int
SIGXCPU = ... # type: int
SIGXFSZ = ... # type: int
SIG_DFL = ... # type: long
SIG_IGN = ... # type: long
NSIG = ... # type: int
def alarm(a: int) -> int: ...
# Python 3 only:
CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 0
GSIG = 0
class ItimerError(IOError): ...
_HANDLER = Union[Callable[[int, Any], Any], int, None]
def alarm(time: int) -> int: ...
def getsignal(signalnum: int) -> _HANDLER: ...
def pause() -> None: ...
def setitimer(which: int, seconds: float, interval: float = None) -> Tuple[float, float]: ...
def getitimer(which: int) -> Tuple[float, float]: ...
def set_wakeup_fd(fd: int) -> long: ...
def siginterrupt(signalnum: int, flag: bool) -> None:
raise RuntimeError()
def signal(signalnum: int, handler: _HANDLER) -> None:
raise RuntimeError()
def default_int_handler(*args, **kwargs) -> Any:
raise KeyboardInterrupt()
def getitimer(a: int) -> tuple: ...
def getsignal(a: int) -> None:
raise ValueError()
def pause() -> None: ...
def set_wakeup_fd(a: int) -> long:
raise ValueError()
def setitimer(a: int, b: float, *args, **kwargs) -> tuple: ...
def siginterrupt(a: int, b: int) -> None:
raise RuntimeError()
raise ValueError()
def signal(a: int, b) -> None:
raise RuntimeError()
raise TypeError()
raise ValueError()