Rename some confusingly named type aliases (#8129)

This commit is contained in:
Alex Waygood
2022-06-21 20:51:05 +01:00
committed by GitHub
parent 73ec67587c
commit 8826d3a36f
6 changed files with 100 additions and 100 deletions

View File

@@ -8,7 +8,7 @@ from typing_extensions import Literal, TypeAlias
class _EncodingMap:
def size(self) -> int: ...
_MapT: TypeAlias = dict[int, int] | _EncodingMap
_CharMap: TypeAlias = dict[int, int] | _EncodingMap
_Handler: TypeAlias = Callable[[UnicodeError], tuple[str | bytes, int]]
_SearchFunction: TypeAlias = Callable[[str], codecs.CodecInfo | None]
@@ -66,11 +66,11 @@ def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = ...) -
@overload
def decode(obj: bytes, encoding: str = ..., errors: str = ...) -> str: ...
def lookup(__encoding: str) -> codecs.CodecInfo: ...
def charmap_build(__map: str) -> _MapT: ...
def charmap_build(__map: str) -> _CharMap: ...
def ascii_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def ascii_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[str, int]: ...
def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[bytes, int]: ...
def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[str, int]: ...
def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[bytes, int]: ...
def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...