mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-18 17:15:08 +08:00
Add stubs to classes in zipfile to better enable subclassing (#2707)
This commit is contained in:
committed by
Jelle Zijlstra
parent
93150dc0fa
commit
893089d143
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user