From 8d3c6b14f6835636a56a8af52bf0430900b85bb8 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Mon, 3 Apr 2017 12:37:20 -0400 Subject: [PATCH] Move struct into 2and3 (#1129) --- stdlib/{2 => 2and3}/struct.pyi | 0 stdlib/3/struct.pyi | 40 ---------------------------------- 2 files changed, 40 deletions(-) rename stdlib/{2 => 2and3}/struct.pyi (100%) delete mode 100644 stdlib/3/struct.pyi diff --git a/stdlib/2/struct.pyi b/stdlib/2and3/struct.pyi similarity index 100% rename from stdlib/2/struct.pyi rename to stdlib/2and3/struct.pyi diff --git a/stdlib/3/struct.pyi b/stdlib/3/struct.pyi deleted file mode 100644 index be4474ecd..000000000 --- a/stdlib/3/struct.pyi +++ /dev/null @@ -1,40 +0,0 @@ -# Stubs for struct - -# Based on http://docs.python.org/3.2/library/struct.html -# Based on http://docs.python.org/2/library/struct.html - -import sys -from typing import Any, Tuple, Text, Union, Iterator -from array import array - -class error(Exception): ... - -_FmtType = Union[bytes, Text] -if sys.version_info >= (3,): - _BufferType = Union[bytes, bytearray, memoryview] - _WriteBufferType = Union[array, bytearray, memoryview] -else: - _BufferType = Union[bytes, bytearray, buffer, memoryview] - _WriteBufferType = Union[array[Any], bytearray, buffer, memoryview] - -def pack(fmt: _FmtType, *v: Any) -> bytes: ... -def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... -def unpack(fmt: _FmtType, buffer: _BufferType) -> Tuple[Any, ...]: ... -def unpack_from(fmt: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... -if sys.version_info >= (3, 4): - def iter_unpack(fmt: _FmtType, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... - -def calcsize(fmt: _FmtType) -> int: ... - -class Struct: - format = ... # type: bytes - size = ... # type: int - - def __init__(self, format: _FmtType) -> None: ... - - def pack(self, *v: Any) -> bytes: ... - def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... - def unpack(self, buffer: _BufferType) -> Tuple[Any, ...]: ... - def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... - if sys.version_info >= (3, 4): - def iter_unpack(self, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ...