mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-26 11:37:16 +08:00
add (overwrite with) mypy stubs, if available
This commit is contained in:
29
stdlib/3/zipfile.pyi
Normal file
29
stdlib/3/zipfile.pyi
Normal file
@@ -0,0 +1,29 @@
|
||||
# TODO these are incomplete
|
||||
|
||||
from typing import List, Tuple, BinaryIO, Union
|
||||
|
||||
ZIP_STORED = 0
|
||||
ZIP_DEFLATED = 0
|
||||
|
||||
def is_zipfile(filename: Union[str, BinaryIO]) -> bool: ...
|
||||
|
||||
class ZipInfo:
|
||||
filename = ''
|
||||
date_time = ... # type: Tuple[int, int, int, int, int, int]
|
||||
compressed_size = 0
|
||||
file_size = 0
|
||||
|
||||
class ZipFile:
|
||||
def __init__(self, file: Union[str, BinaryIO], mode: str = 'r',
|
||||
compression: int = ZIP_STORED,
|
||||
allowZip64: bool = False) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def getinfo(name: str) -> ZipInfo: ...
|
||||
def infolist(self) -> List[ZipInfo]: ...
|
||||
def namelist(self) -> List[str]: ...
|
||||
def read(self, name: Union[str, ZipInfo], pwd: str = None) -> bytes: ...
|
||||
def write(self, filename: str, arcname: str = None,
|
||||
compress_type: int = None) -> None: ...
|
||||
|
||||
def __enter__(self) -> 'ZipFile': ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
Reference in New Issue
Block a user