Python 3.14: PEP-784 compression.zstd (#14129)

This commit is contained in:
Rogdham
2025-06-02 13:02:27 +02:00
committed by GitHub
parent 0c4ae3edaa
commit 798f332afa
8 changed files with 314 additions and 11 deletions
+6 -5
View File
@@ -2,7 +2,8 @@ import sys
from _bz2 import BZ2Compressor as BZ2Compressor, BZ2Decompressor as BZ2Decompressor
from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer
from collections.abc import Iterable
from typing import IO, Literal, Protocol, SupportsIndex, TextIO, overload
from io import TextIOWrapper
from typing import IO, Literal, Protocol, SupportsIndex, overload
from typing_extensions import Self, TypeAlias
if sys.version_info >= (3, 14):
@@ -48,7 +49,7 @@ def open(
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
) -> TextIO: ...
) -> TextIOWrapper: ...
@overload
def open(
filename: _WritableFileobj,
@@ -66,7 +67,7 @@ def open(
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
) -> TextIO: ...
) -> TextIOWrapper: ...
@overload
def open(
filename: StrOrBytesPath,
@@ -84,7 +85,7 @@ def open(
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
) -> TextIO: ...
) -> TextIOWrapper: ...
@overload
def open(
filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj,
@@ -93,7 +94,7 @@ def open(
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
) -> BZ2File | TextIO: ...
) -> BZ2File | TextIOWrapper: ...
class BZ2File(BaseStream, IO[bytes]):
def __enter__(self) -> Self: ...