complete Python 3 gzip stub (#1723)

* complete python 3 gzip stub
* IOBase.closed is read-only
This commit is contained in:
Jelle Zijlstra
2017-11-09 05:56:55 -08:00
committed by Matthias Kramm
parent a1238294d7
commit eaf8972e48
2 changed files with 38 additions and 35 deletions

View File

@@ -1,47 +1,49 @@
from typing import Any, Optional
from typing import Any, IO, Optional
from os.path import _PathType
import _compression
import zlib
def open(filename, mode: str = ..., compresslevel: int = ..., encoding=None, errors=None, newline=None): ...
def open(filename, mode: str = ..., compresslevel: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ...) -> IO[Any]: ...
class _PaddedFile:
file = ... # type: Any
def __init__(self, f, prepend: bytes = ...) -> None: ...
def read(self, size): ...
def prepend(self, prepend: bytes = ...): ...
def seek(self, off): ...
def seekable(self): ...
file: IO[bytes]
def __init__(self, f: IO[bytes], prepend: bytes = ...) -> None: ...
def read(self, size: int) -> bytes: ...
def prepend(self, prepend: bytes = ...) -> None: ...
def seek(self, off: int) -> int: ...
def seekable(self) -> bool: ...
class GzipFile(_compression.BaseStream):
myfileobj = ... # type: Any
mode = ... # type: Any
name = ... # type: Any
compress = ... # type: Any
fileobj = ... # type: Any
def __init__(self, filename=None, mode=None, compresslevel: int = ..., fileobj=None, mtime=None) -> None: ...
myfileobj: Optional[IO[bytes]]
mode: str
name: str
compress: zlib._Compress
fileobj: IO[bytes]
def __init__(self, filename: Optional[_PathType] = ..., mode: Optional[str] = ..., compresslevel: int = ..., fileobj: Optional[IO[bytes]] = ..., mtime: Optional[float] = ...) -> None: ...
@property
def filename(self): ...
def filename(self) -> str: ...
@property
def mtime(self): ...
crc = ... # type: Any
def write(self, data): ...
def read(self, size: Optional[int] = ...): ...
def read1(self, size: int = ...): ...
def peek(self, n): ...
crc: int
def write(self, data: bytes) -> int: ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def read1(self, size: int = ...) -> bytes: ...
def peek(self, n: int) -> bytes: ...
@property
def closed(self): ...
def close(self): ...
def flush(self, zlib_mode=...): ...
def fileno(self): ...
def rewind(self): ...
def readable(self): ...
def writable(self): ...
def seekable(self): ...
def seek(self, offset, whence=...): ...
def readline(self, size: int = ...): ...
def closed(self) -> bool: ...
def close(self) -> None: ...
def flush(self, zlib_mode: int = ...) -> None: ...
def fileno(self) -> int: ...
def rewind(self) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def seekable(self) -> bool: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def readline(self, size: int = ...) -> bytes: ...
class _GzipReader(_compression.DecompressReader):
def __init__(self, fp) -> None: ...
def read(self, size: int = ...): ...
def __init__(self, fp: IO[bytes]) -> None: ...
def read(self, size: int = ...) -> bytes: ...
def compress(data, compresslevel: int = ...): ...
def decompress(data): ...
def compress(data, compresslevel: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...

View File

@@ -49,7 +49,8 @@ class IOBase:
else:
def readline(self, limit: int = ...) -> bytes: ...
if sys.version_info >= (3, 2):
closed = ... # type: bool
@property
def closed(self) -> bool: ...
else:
def closed(self) -> bool: ...