From 0ccbc29919fd501df9cba873899e26400591c3e0 Mon Sep 17 00:00:00 2001 From: PabloLION <36828324+PabloLION@users.noreply.github.com> Date: Wed, 2 Feb 2022 23:05:16 +0100 Subject: [PATCH] fix: enable encode/decode from/to hex string (#7115) --- stdlib/codecs.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/codecs.pyi b/stdlib/codecs.pyi index 2a3e5d72d..aa5756fec 100644 --- a/stdlib/codecs.pyi +++ b/stdlib/codecs.pyi @@ -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: ...