mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-09-19 17:53:16 +08:00
Update a bunch of stubs
This commit is contained in:
+38
-14
@@ -1,12 +1,14 @@
|
||||
"""Stub file for the 'signal' module."""
|
||||
|
||||
from typing import Any, Callable, List, Tuple, Dict, Generic, Union
|
||||
from typing import Any, Callable, List, Tuple, Dict, Generic, Union, Optional, Iterable
|
||||
from types import FrameType
|
||||
|
||||
class ItimerError(IOError): ...
|
||||
|
||||
ITIMER_PROF = ... # type: int
|
||||
ITIMER_REAL = ... # type: int
|
||||
ITIMER_VIRTUAL = ... # type: int
|
||||
|
||||
NSIG = ... # type: int
|
||||
SIGABRT = ... # type: int
|
||||
SIGALRM = ... # type: int
|
||||
@@ -43,51 +45,73 @@ 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
|
||||
|
||||
SIG_BLOCK = ... # type: int
|
||||
SIG_UNBLOCK = ... # type: int
|
||||
SIG_SETMASK = ... # type: int
|
||||
|
||||
_HANDLER = Union[Callable[[int, FrameType], None], int, None]
|
||||
|
||||
class struct_siginfo(Tuple[int, int, int, int, int, int, int]):
|
||||
def __init__(self, sequence: Iterable[int]) -> None: ...
|
||||
@property
|
||||
def si_signo(self) -> int: ...
|
||||
@property
|
||||
def si_code(self) -> int: ...
|
||||
@property
|
||||
def si_errno(self) -> int: ...
|
||||
@property
|
||||
def si_pid(self) -> int: ...
|
||||
@property
|
||||
def si_uid(self) -> int: ...
|
||||
@property
|
||||
def si_status(self) -> int: ...
|
||||
@property
|
||||
def si_band(self) -> int: ...
|
||||
|
||||
def alarm(time: int) -> int: ...
|
||||
|
||||
def default_int_handler(*args, **kwargs) -> Any:
|
||||
def default_int_handler(signum: int, frame: FrameType) -> None:
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
def getitimer(which: int) -> tuple: ...
|
||||
def getitimer(which: int) -> Tuple[float, float]: ...
|
||||
|
||||
def getsignal(signalnum: int) -> None:
|
||||
def getsignal(signalnum: int) -> _HANDLER:
|
||||
raise ValueError()
|
||||
|
||||
def pause() -> None: ...
|
||||
|
||||
def pthread_kill(a: int, b: int) -> None:
|
||||
def pthread_kill(thread_id: int, signum: int) -> None:
|
||||
raise OSError()
|
||||
|
||||
def pthread_sigmask(a: int, b) -> Any:
|
||||
def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[int]:
|
||||
raise OSError()
|
||||
|
||||
def set_wakeup_fd(fd: int) -> int: ...
|
||||
|
||||
def setitimer(which: int, seconds: float, internval: float = ...) -> Tuple[float, float]: ...
|
||||
def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ...
|
||||
|
||||
def siginterrupt(signalnum: int, flag: int) -> None:
|
||||
def siginterrupt(signalnum: int, flag: bool) -> None:
|
||||
raise OSError()
|
||||
|
||||
def signal(signalnum: int, handler: Union[int, Callable[[int, Any], None]]) -> Any:
|
||||
def signal(signalnum: int, handler: _HANDLER) -> _HANDLER:
|
||||
raise OSError()
|
||||
|
||||
def sigpending() -> Any:
|
||||
raise OSError()
|
||||
|
||||
def sigtimedwait(a, b) -> Any:
|
||||
def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]:
|
||||
raise OSError()
|
||||
raise ValueError()
|
||||
|
||||
def sigwait(a) -> int:
|
||||
def sigwait(sigset: Iterable[int]) -> int:
|
||||
raise OSError()
|
||||
|
||||
def sigwaitinfo(a) -> tuple:
|
||||
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo:
|
||||
raise OSError()
|
||||
|
||||
... # TODO frame object type
|
||||
|
||||
Reference in New Issue
Block a user