Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions zstandard/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import os
from typing import (
IO,
BinaryIO,
ByteString,
Generator,
Expand All @@ -18,6 +17,11 @@ from typing import (
Union,
)

from _typeshed import (
SupportsRead,
SupportsWrite,
)

FLUSH_BLOCK: int
FLUSH_FRAME: int

Expand Down Expand Up @@ -278,23 +282,23 @@ class ZstdCompressor(object):
) -> ZstdCompressionChunker: ...
def copy_stream(
self,
ifh: IO[bytes],
ofh: IO[bytes],
ifh: SupportsRead[bytes],
ofh: SupportsWrite[bytes],
size: int = ...,
read_size: int = ...,
write_size: int = ...,
) -> Tuple[int, int]: ...
def stream_reader(
self,
source: Union[IO[bytes], ByteString],
source: Union[SupportsRead[bytes], ByteString],
size: int = ...,
read_size: int = ...,
*,
closefd: bool = ...,
) -> ZstdCompressionReader: ...
def stream_writer(
self,
writer: IO[bytes],
writer: SupportsWrite[bytes],
size: int = ...,
write_size: int = ...,
write_return_read: bool = ...,
Expand All @@ -303,7 +307,7 @@ class ZstdCompressor(object):
) -> ZstdCompressionWriter: ...
def read_to_iter(
self,
reader: Union[IO[bytes], ByteString],
reader: Union[SupportsRead[bytes], ByteString],
size: int = ...,
read_size: int = ...,
write_size: int = ...,
Expand Down Expand Up @@ -396,7 +400,7 @@ class ZstdDecompressor(object):
) -> bytes: ...
def stream_reader(
self,
source: Union[IO[bytes], ByteString],
source: Union[SupportsRead[bytes], ByteString],
read_size: int = ...,
read_across_frames: bool = ...,
*,
Expand All @@ -407,23 +411,23 @@ class ZstdDecompressor(object):
) -> ZstdDecompressionObj: ...
def read_to_iter(
self,
reader: Union[IO[bytes], ByteString],
reader: Union[SupportsRead[bytes], ByteString],
read_size: int = ...,
write_size: int = ...,
skip_bytes: int = ...,
) -> Generator[bytes, None, None]: ...
def stream_writer(
self,
writer: IO[bytes],
writer: SupportsWrite[bytes],
write_size: int = ...,
write_return_read: bool = ...,
*,
closefd: bool = ...,
) -> ZstdDecompressionWriter: ...
def copy_stream(
self,
ifh: IO[bytes],
ofh: IO[bytes],
ifh: SupportsRead[bytes],
ofh: SupportsWrite[bytes],
read_size: int = ...,
write_size: int = ...,
) -> Tuple[int, int]: ...
Expand Down