diff --git a/stdlib/2/zlib.pyi b/stdlib/2/zlib.pyi deleted file mode 100644 index a232cc541..000000000 --- a/stdlib/2/zlib.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# Stubs for zlib (Python 2.7) - -DEFLATED = ... # type: int -DEF_MEM_LEVEL = ... # type: int -MAX_WBITS = ... # type: int -ZLIB_VERSION = ... # type: str -Z_BEST_COMPRESSION = ... # type: int -Z_BEST_SPEED = ... # type: int -Z_DEFAULT_COMPRESSION = ... # type: int -Z_DEFAULT_STRATEGY = ... # type: int -Z_FILTERED = ... # type: int -Z_FINISH = ... # type: int -Z_FULL_FLUSH = ... # type: int -Z_HUFFMAN_ONLY = ... # type: int -Z_NO_FLUSH = ... # type: int -Z_SYNC_FLUSH = ... # type: int - - -class error(Exception): ... - - -class Compress: - def compress(self, data: str) -> str: ... - def flush(self) -> str: ... - def copy(self) -> "Compress": ... - - -class Decompress: - unused_data = ... # type: str - unconsumed_tail = ... # type: str - def decompress(self, data: str, max_length: int = ...) -> str: ... - def flush(self) -> str: ... - def copy(self) -> "Decompress": ... - - -def adler32(data: str, value: int = ...) -> int: ... -def compress(data: str, level: int = ...) -> str: ... -def compressobj(level: int = ..., method: int = ..., wbits: int = ..., - memlevel: int = ..., strategy: int = ...) -> Compress: ... -def crc32(data: str, value: int = ...) -> int: ... -def decompress(data: str, wbits: int = ..., bufsize: int = ...) -> str: ... -def decompressobj(wbits: int = ...) -> Decompress: ... diff --git a/stdlib/3/zlib.pyi b/stdlib/2and3/zlib.pyi similarity index 61% rename from stdlib/3/zlib.pyi rename to stdlib/2and3/zlib.pyi index 39db8439f..34aaf1b09 100644 --- a/stdlib/3/zlib.pyi +++ b/stdlib/2and3/zlib.pyi @@ -1,10 +1,9 @@ # Stubs for zlib +import sys DEFLATED = ... # type: int -DEF_BUF_SIZE = ... # type: int DEF_MEM_LEVEL = ... # type: int MAX_WBITS = ... # type: int -ZLIB_RUNTIME_VERSION = ... # type: str ZLIB_VERSION = ... # type: str Z_BEST_COMPRESSION = ... # type: int Z_BEST_SPEED = ... # type: int @@ -16,7 +15,9 @@ Z_FULL_FLUSH = ... # type: int Z_HUFFMAN_ONLY = ... # type: int Z_NO_FLUSH = ... # type: int Z_SYNC_FLUSH = ... # type: int - +if sys.version_info >= (3,): + DEF_BUF_SIZE = ... # type: int + ZLIB_RUNTIME_VERSION = ... # type: str class error(Exception): ... @@ -30,7 +31,8 @@ class Compress: class Decompress: unused_data = ... # type: bytes unconsumed_tail = ... # type: bytes - eof = ... # type: bool + if sys.version_info >= (3,): + eof = ... # type: bool def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... def flush(self, length: int = ...) -> bytes: ... def copy(self) -> "Decompress": ... @@ -38,9 +40,16 @@ class Decompress: def adler32(data: bytes, value: int = ...) -> int: ... def compress(data: bytes, level: int = ...) -> bytes: ... -def compressobj(level: int = ..., method: int = ..., wbits: int = ..., - memlevel: int = ..., strategy: int = ..., - zdict: bytes = ...) -> Compress: ... +if sys.version_info >= (3,): + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memLevel: int = ..., strategy: int = ..., + zdict: bytes = ...) -> Compress: ... +else: + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memlevel: int = ..., strategy: int = ...) -> Compress: ... def crc32(data: bytes, value: int = ...) -> int: ... def decompress(data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... -def decompressobj(wbits: int = ..., zdict: bytes = ...) -> Decompress: ... +if sys.version_info >= (3,): + def decompressobj(wbits: int = ..., zdict: bytes = ...) -> Decompress: ... +else: + def decompressobj(wbits: int = ...) -> Decompress: ...