mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Implement ZipExtFile in the zipfile type stubs (#3074)
This commit is contained in:
committed by
Jelle Zijlstra
parent
26f575130c
commit
15b7cdaf40
@@ -1,7 +1,8 @@
|
||||
# Stubs for zipfile
|
||||
|
||||
from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union
|
||||
from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union, Sequence, Pattern
|
||||
from types import TracebackType
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -23,6 +24,25 @@ error = BadZipfile
|
||||
|
||||
class LargeZipFile(Exception): ...
|
||||
|
||||
class ZipExtFile(io.BufferedIOBase):
|
||||
MAX_N: int = ...
|
||||
MIN_READ_SIZE: int = ...
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
PATTERN: Pattern = ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
MAX_SEEK_READ: int = ...
|
||||
|
||||
newlines: Optional[List[bytes]]
|
||||
mode: str
|
||||
name: str
|
||||
|
||||
def __init__(self, fileobj: IO[bytes], mode: str, zipinfo: ZipInfo, decrypter: Optional[Callable[[Sequence[int]], bytes]] = ..., close_fileobj: bool = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def peek(self, n: int = ...) -> bytes: ...
|
||||
def read1(self, n: Optional[int]) -> bytes: ... # type: ignore
|
||||
|
||||
class ZipFile:
|
||||
filename: Optional[Text]
|
||||
debug: int
|
||||
|
||||
Reference in New Issue
Block a user