Skip to content

Commit 2c7bae6

Browse files
authored
Use only literal overloads for ZipFile.__init__() (#5504)
1 parent 1547035 commit 2c7bae6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/zipfile.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ class ZipExtFile(io.BufferedIOBase):
5151
) -> None: ...
5252
@overload
5353
def __init__(
54-
self, fileobj: _ZipStream, mode: str, zipinfo: ZipInfo, pwd: Optional[bytes] = ..., close_fileobj: bool = ...
54+
self,
55+
fileobj: _ZipStream,
56+
mode: str,
57+
zipinfo: ZipInfo,
58+
pwd: Optional[bytes] = ...,
59+
close_fileobj: Literal[False] = ...,
5560
) -> None: ...
5661
else:
5762
@overload
@@ -80,7 +85,7 @@ class ZipExtFile(io.BufferedIOBase):
8085
mode: str,
8186
zipinfo: ZipInfo,
8287
decrypter: Optional[Callable[[Sequence[int]], bytes]] = ...,
83-
close_fileobj: bool = ...,
88+
close_fileobj: Literal[False] = ...,
8489
) -> None: ...
8590
def read(self, n: Optional[int] = ...) -> bytes: ...
8691
def readline(self, limit: int = ...) -> bytes: ... # type: ignore

0 commit comments

Comments
 (0)