mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -3,7 +3,7 @@ import sys
|
||||
from _compression import BaseStream
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
|
||||
from typing import IO, Any, Iterable, Protocol, TextIO, overload
|
||||
from typing_extensions import Literal, SupportsIndex, final
|
||||
from typing_extensions import Literal, SupportsIndex, TypeAlias, final
|
||||
|
||||
__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "decompress"]
|
||||
|
||||
@@ -21,10 +21,10 @@ class _WritableFileobj(Protocol):
|
||||
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
|
||||
def decompress(data: bytes) -> bytes: ...
|
||||
|
||||
_ReadBinaryMode = Literal["", "r", "rb"]
|
||||
_WriteBinaryMode = Literal["w", "wb", "x", "xb", "a", "ab"]
|
||||
_ReadTextMode = Literal["rt"]
|
||||
_WriteTextMode = Literal["wt", "xt", "at"]
|
||||
_ReadBinaryMode: TypeAlias = Literal["", "r", "rb"]
|
||||
_WriteBinaryMode: TypeAlias = Literal["w", "wb", "x", "xb", "a", "ab"]
|
||||
_ReadTextMode: TypeAlias = Literal["rt"]
|
||||
_WriteTextMode: TypeAlias = Literal["wt", "xt", "at"]
|
||||
|
||||
@overload
|
||||
def open(
|
||||
|
||||
Reference in New Issue
Block a user