mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
fix: enable encode/decode from/to hex string (#7115)
This commit is contained in:
@@ -58,13 +58,13 @@ _BytesToBytesEncodingT = Literal[
|
||||
@overload
|
||||
def encode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ...
|
||||
@overload
|
||||
def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ... # type: ignore[misc]
|
||||
def encode(obj: str, encoding: Literal["rot13", "rot_13", "hex"] = ..., errors: str = ...) -> str: ... # type: ignore[misc]
|
||||
@overload
|
||||
def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ...
|
||||
@overload
|
||||
def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... # type: ignore[misc]
|
||||
@overload
|
||||
def decode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ...
|
||||
def decode(obj: str, encoding: Literal["rot13", "rot_13", "hex"] = ..., errors: str = ...) -> str: ...
|
||||
@overload
|
||||
def decode(obj: bytes, encoding: str = ..., errors: str = ...) -> str: ...
|
||||
def lookup(__encoding: str) -> CodecInfo: ...
|
||||
|
||||
Reference in New Issue
Block a user