From 5a1ea5efb2f5df6055fde9db9e38d72a072a39c9 Mon Sep 17 00:00:00 2001 From: tikki <601529+tikki@users.noreply.github.com> Date: Mon, 6 Aug 2018 18:48:53 +0200 Subject: [PATCH] Minor fixes for zipfile (#2360) * Add `is_dir` to `ZipFile` * Allow `pathlib.Path` for `is_zipfile` --- stdlib/2and3/zipfile.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/zipfile.pyi b/stdlib/2and3/zipfile.pyi index 9ec363154..236c08e53 100644 --- a/stdlib/2and3/zipfile.pyi +++ b/stdlib/2and3/zipfile.pyi @@ -57,6 +57,8 @@ class ZipFile: def writestr(self, zinfo_or_arcname: _SZI, bytes: bytes, compress_type: Optional[int] = ...) -> None: ... + if sys.version_info >= (3, 6): + def is_dir(self) -> bool: ... class PyZipFile(ZipFile): if sys.version_info >= (3,): @@ -92,7 +94,7 @@ class ZipInfo: date_time: Optional[_DT] = ...) -> None: ... -def is_zipfile(filename: Union[Text, IO[bytes]]) -> bool: ... +def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ... ZIP_STORED = ... # type: int ZIP_DEFLATED = ... # type: int