diff --git a/stdlib/2.7/inspect.pyi b/stdlib/2.7/inspect.pyi index f59dec6aa..b1cfb9c56 100644 --- a/stdlib/2.7/inspect.pyi +++ b/stdlib/2.7/inspect.pyi @@ -9,3 +9,12 @@ _FrameRecord = Tuple[_Frame, str, int, str, List[str], int] def currentframe() -> _FrameRecord: ... def stack(context: int = ...) -> List[_FrameRecord]: ... + +# namedtuple('ArgSpec', 'args varargs keywords defaults') +class ArgSpec(tuple): + args = ... # type: List[str] + varargs = ... # type: str + keywords = ... # type: str + defaults = ... # type: tuple + +def getargspec(func: object) -> ArgSpec: ... diff --git a/stdlib/2.7/zlib.pyi b/stdlib/2.7/zlib.pyi index 72bfc88c1..d6a2c8cdc 100644 --- a/stdlib/2.7/zlib.pyi +++ b/stdlib/2.7/zlib.pyi @@ -23,14 +23,14 @@ def crc32(data: str, value: int = ...) -> int: ... def decompress(data: str, wbits: int = ..., bufsize: int = ...) -> str: ... class compressobj: - def __init__(level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ..., + def __init__(self, level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ..., strategy: int = ...) -> None: ... def copy(self) -> "compressobj": ... def compress(self, data: str) -> str: ... def flush(self) -> None: ... class decompressobj: - def __init__(wbits: int = ...) -> None: ... + def __init__(self, wbits: int = ...) -> None: ... def copy(self) -> "decompressobj": ... - def decompress(self, data: str) -> str: ... + def decompress(self, data: str, max_length: int = ...) -> str: ... def flush(self) -> None: ... diff --git a/stdlib/3/inspect.pyi b/stdlib/3/inspect.pyi index 9286aa04f..710d7f3b4 100644 --- a/stdlib/3/inspect.pyi +++ b/stdlib/3/inspect.pyi @@ -1,6 +1,6 @@ # Stubs for inspect -from typing import Any, Tuple, List, Callable +from typing import Any, Tuple, List, Dict, Callable from types import FrameType _object = object @@ -31,4 +31,16 @@ class ArgSpec(tuple): def getargspec(func: object) -> ArgSpec: ... +# namedtuple('FullArgSpec', 'args varargs varkw defaults kwonlyargs kwonlydefaults annotations') +class FullArgSpec(tuple): + args = ... # type: List[str] + varargs = ... # type: str + varkw = ... # type: str + defaults = ... # type: tuple + kwonlyargs = ... # type: List[str] + kwonlydefaults = ... # type: Dict[str, Any] + annotations = ... # type: Dict[str, Any] + +def getfullargspec(func: object) -> FullArgSpec: ... + def stack() -> List[Tuple[FrameType, str, int, str, List[str], int]]: ... diff --git a/stdlib/3/textwrap.pyi b/stdlib/3/textwrap.pyi index db8b5bf55..f6441042a 100644 --- a/stdlib/3/textwrap.pyi +++ b/stdlib/3/textwrap.pyi @@ -61,6 +61,7 @@ class TextWrapper: def wrap( + text: str = ..., width: int = ..., *, initial_indent: str = ..., diff --git a/stdlib/3/threading.pyi b/stdlib/3/threading.pyi index a3e2597ba..ea4386d2b 100644 --- a/stdlib/3/threading.pyi +++ b/stdlib/3/threading.pyi @@ -23,6 +23,12 @@ class Thread: def isDaemon(self) -> bool: ... def setDaemon(self, daemon: bool) -> None: ... +class local(object): + # TODO: allows arbitrary parameters... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + class Event: def is_set(self) -> bool: ... def set(self) -> None: ...