mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Rename some confusingly named type aliases (#8129)
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user