Apply fixes, remove duplicates.

Apply fixes to _random, cStringIO, errno, operator, sys, zlib, etc.; also,
remove duplicate 2.7/math.pyi, 2.7/marshal.pyi.
This commit is contained in:
Matthias Kramm
2015-09-30 12:04:57 -07:00
parent fc2ddb852c
commit 56dcc02e25
19 changed files with 734 additions and 605 deletions

View File

@@ -1,51 +1,93 @@
# Stubs for signal
"""Stub file for the 'signal' module."""
# Based on http://docs.python.org/3.2/library/signal.html
from typing import Any, Callable, List, Tuple, Dict, Generic, Union
from typing import Any, overload, Callable
class ItimerError(IOError): ...
SIG_DFL = 0
SIG_IGN = 0
# TODO more SIG* constants (these should be platform specific?)
SIGHUP = 0
SIGINT = 0
SIGQUIT = 0
SIGABRT = 0
SIGKILL = 0
SIGALRM = 0
SIGTERM = 0
SIGUSR1 = 0
SIGUSR2 = 0
SIGCONT = 0
SIGSTOP = 0
SIGPOLL = 0
SIGVTALRM = 0
ITIMER_PROF = ... # type: int
ITIMER_REAL = ... # type: int
ITIMER_VIRTUAL = ... # type: int
NSIG = ... # type: int
SIGABRT = ... # type: int
SIGALRM = ... # type: int
SIGBUS = ... # type: int
SIGCHLD = ... # type: int
SIGCLD = ... # type: int
SIGCONT = ... # type: int
SIGFPE = ... # type: int
SIGHUP = ... # type: int
SIGILL = ... # type: int
SIGINT = ... # type: int
SIGIO = ... # type: int
SIGIOT = ... # type: int
SIGKILL = ... # type: int
SIGPIPE = ... # type: int
SIGPOLL = ... # type: int
SIGPROF = ... # type: int
SIGPWR = ... # type: int
SIGQUIT = ... # type: int
SIGRTMAX = ... # type: int
SIGRTMIN = ... # type: int
SIGSEGV = ... # type: int
SIGSTOP = ... # type: int
SIGSYS = ... # type: int
SIGTERM = ... # type: int
SIGTRAP = ... # type: int
SIGTSTP = ... # type: int
SIGTTIN = ... # type: int
SIGTTOU = ... # type: int
SIGURG = ... # type: int
SIGUSR1 = ... # type: int
SIGUSR2 = ... # type: int
SIGVTALRM = ... # type: int
SIGWINCH = ... # type: int
SIGXCPU = ... # type: int
SIGXFSZ = ... # type: int
SIG_DFL = ... # type: int
SIG_IGN = ... # type: int
CTRL_C_EVENT = 0 # Windows
CTRL_BREAK_EVENT = 0 # Windows
NSIG = 0
ITIMER_REAL = 0
ITIMER_VIRTUAL = 0
ITIMER_PROF = 0
def alarm(time: int) -> int: ...
class ItimerError(IOError): ...
def default_int_handler(*args, **kwargs) -> Any:
raise KeyboardInterrupt()
def alarm(time: int) -> int: ... # Unix
def getsignal(signalnum: int) -> Any: ...
def pause() -> None: ... # Unix
#def setitimer(which: int, seconds: float,
# internval: float = None) -> Tuple[float, float]: ... # Unix
#def getitimer(int which): ... # Unix
def set_wakeup_fd(fd: int) -> None: ...
def siginterrupt(signalnum: int, flag: bool) -> None: ...
def getitimer(which: int) -> tuple: ...
@overload
def signal(signalnum: int, handler: int) -> Any: ...
@overload
def signal(signalnum: int,
handler: Callable[[int, Any], None]) -> Any:
... # TODO frame object type
def getsignal(signalnum: int) -> None:
raise ValueError()
def pause() -> None: ...
def pthread_kill(a: int, b: int) -> None:
raise OSError()
def pthread_sigmask(a: int, b) -> Any:
raise OSError()
def set_wakeup_fd(fd: int) -> int: ...
def setitimer(which: int, seconds: float, internval: float = ...) -> Tuple[float, float]: ...
def siginterrupt(signalnum: int, flag: int) -> None:
raise OSError()
def signal(signalnum: int, handler: Union[int, Callable[[int, Any], None]]) -> Any:
raise OSError()
def sigpending() -> Any:
raise OSError()
def sigtimedwait(a, b) -> Any:
raise OSError()
raise ValueError()
def sigwait(a) -> int:
raise OSError()
def sigwaitinfo(a) -> tuple:
raise OSError()
... # TODO frame object type