From 469ef878d26773fe530e3858a2a4be7be0eea6e4 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 24 Sep 2015 07:37:57 -0700 Subject: [PATCH] clean up _struct.pyi --- builtins/2.7/_struct.pyi | 41 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/builtins/2.7/_struct.pyi b/builtins/2.7/_struct.pyi index 1f18f1132..a0700f203 100644 --- a/builtins/2.7/_struct.pyi +++ b/builtins/2.7/_struct.pyi @@ -1,29 +1,20 @@ """Stub file for the '_struct' 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, Generic - -def _clearcache() -> None: ... - -def calcsize(*args, **kwargs) -> int: ... - -def pack(*args, **kwargs) -> str: - raise TypeError() - -def pack_into(*args, **kwargs) -> None: - raise TypeError() - -def unpack(*args, **kwargs) -> tuple: ... - -def unpack_from(*args, **kwargs) -> tuple: - raise TypeError() +class error(Exception): ... class Struct(object): - def __sizeof__(self) -> long: ... - def pack(self, *args, **kwargs) -> str: ... - def pack_into(self, *args, **kwargs) -> None: ... - def unpack(self, a) -> tuple: ... - def unpack_from(self, *args, **kwargs) -> tuple: ... + size = ... # type: int + format = ... # type: str + + def __init__(self, fmt: str) -> None: ... + def pack_into(buffer: bytearray, offset: int, obj: Any) -> None: ... + def pack(self, *args) -> str: ... + def unpack(self, s:str) -> Tuple[Any]: ... + def unpack_from(self, buffer: bytearray, offset:int = ...) -> Tuple[Any]: ... + +def _clearcache() -> None: ... +def calcsize(fmt: str) -> int: ... +def pack(fmt: AnyStr, obj: Any) -> str: ... +def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ... +def unpack(fmt: AnyStr, data: str) -> Tuple[Any]: ... +def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any]: ...