From 893089d14313452aa9609b7bbf6504c87276080d Mon Sep 17 00:00:00 2001 From: Alex Sarkesian Date: Sat, 5 Jan 2019 13:43:26 -0500 Subject: [PATCH] Add stubs to classes in zipfile to better enable subclassing (#2707) --- stdlib/2and3/zipfile.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/zipfile.pyi b/stdlib/2and3/zipfile.pyi index e3468ce6b..df21d2d7e 100644 --- a/stdlib/2and3/zipfile.pyi +++ b/stdlib/2and3/zipfile.pyi @@ -1,6 +1,6 @@ # Stubs for zipfile -from typing import Callable, IO, Iterable, List, Optional, Text, Tuple, Type, Union +from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union from types import TracebackType import os import sys @@ -27,6 +27,8 @@ class ZipFile: debug = ... # type: int comment = ... # type: bytes filelist = ... # type: List[ZipInfo] + fp = ... # type: IO[bytes] + NameToInfo = ... # type: Dict[str, ZipInfo] def __init__(self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ..., allowZip64: bool = ...) -> None: ... def __enter__(self) -> ZipFile: ... @@ -91,6 +93,7 @@ class ZipInfo: date_time: Optional[_DT] = ...) -> None: ... if sys.version_info >= (3, 6): def is_dir(self) -> bool: ... + def FileHeader(self, zip64: Optional[bool] = ...) -> bytes: ... def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ...