From 2950f3a1af710f3f28e8bbf39a20b4504c4e3c31 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 22 Jan 2020 12:02:40 -0800 Subject: [PATCH 1/5] _codecs: mark positional-only args as such --- stdlib/2and3/_codecs.pyi | 90 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/stdlib/2and3/_codecs.pyi b/stdlib/2and3/_codecs.pyi index c9762567dc33..f6837b38bc67 100644 --- a/stdlib/2and3/_codecs.pyi +++ b/stdlib/2and3/_codecs.pyi @@ -21,55 +21,55 @@ class _EncodingMap(object): def size(self) -> int: ... _MapT = Union[Dict[int, int], _EncodingMap] -def register(search_function: Callable[[str], Any]) -> None: ... -def register_error(errors: Union[str, Text], handler: _Handler) -> None: ... -def lookup(encoding: Union[str, Text]) -> codecs.CodecInfo: ... -def lookup_error(name: Union[str, Text]) -> _Handler: ... +def register(__search_function: Callable[[str], Any]) -> None: ... +def register_error(__errors: Union[str, Text], __handler: _Handler) -> None: ... +def lookup(__encoding: Union[str, Text]) -> codecs.CodecInfo: ... +def lookup_error(__name: Union[str, Text]) -> _Handler: ... def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... -def charmap_build(map: Text) -> _MapT: ... +def charmap_build(__map: Text) -> _MapT: ... -def ascii_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... -def ascii_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def charbuffer_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def charmap_decode(data: _Decodable, errors: _Errors = ..., mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... -def charmap_encode(data: _Encodable, errors: _Errors, mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... -def escape_decode(data: _String, errors: _Errors = ...) -> Tuple[str, int]: ... -def escape_encode(data: bytes, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def latin_1_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... -def latin_1_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def raw_unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... -def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... -def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def ascii_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... +def charmap_encode(__data: _Encodable, __errors: _Errors, __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ... +def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def latin_1_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def raw_unicode_escape_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_escape_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.version_info < (3, 8): - def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... - def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_16_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... -def utf_16_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_32_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_32_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_32_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... -def utf_32_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_7_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_7_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_8_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_8_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def unicode_internal_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... + def unicode_internal_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_be_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_encode(__data: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... +def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_le_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_be_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_encode(__data: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... +def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_le_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_7_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_8_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.platform == 'win32': - def mbcs_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def mbcs_encode(str: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def mbcs_encode(str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.version_info >= (3, 0): - def oem_decode(data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def code_page_decode(codepage: int, data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def oem_encode(str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... - def code_page_encode(code_page: int, str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def oem_decode(__data: bytes, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def code_page_decode(codepage: int, __data: bytes, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def oem_encode(str: Text, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + def code_page_encode(code_page: int, str: Text, __errors: _Errors = ...) -> Tuple[bytes, int]: ... From 434a23a97badfcba5f50bf3fa07c80f65ed7de02 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 22 Jan 2020 12:07:49 -0800 Subject: [PATCH 2/5] _codecs: rename __data to __str where relevant Doesn't actually make a difference, but since I'm here might as well --- stdlib/2and3/_codecs.pyi | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/stdlib/2and3/_codecs.pyi b/stdlib/2and3/_codecs.pyi index f6837b38bc67..d782fb683a0a 100644 --- a/stdlib/2and3/_codecs.pyi +++ b/stdlib/2and3/_codecs.pyi @@ -30,40 +30,40 @@ def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> def charmap_build(__map: Text) -> _MapT: ... def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... -def ascii_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... -def charmap_encode(__data: _Encodable, __errors: _Errors, __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def charmap_encode(__str: _Encodable, __errors: _Errors, __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ... def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... -def latin_1_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... -def raw_unicode_escape_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... -def unicode_escape_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.version_info < (3, 8): - def unicode_internal_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... - def unicode_internal_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... + def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_16_be_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_16_encode(__data: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... def utf_16_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_16_le_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_32_be_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_32_encode(__data: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... def utf_32_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_32_le_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_7_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... -def utf_8_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.platform == 'win32': def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... From 6f514337cb7d88cf7e8024c219688e0dd6e2ac62 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 22 Jan 2020 12:10:25 -0800 Subject: [PATCH 3/5] _codecs: fix utf_16_ex_decode and utf_32_ex_decode --- stdlib/2and3/_codecs.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/_codecs.pyi b/stdlib/2and3/_codecs.pyi index d782fb683a0a..40afa562f8e7 100644 --- a/stdlib/2and3/_codecs.pyi +++ b/stdlib/2and3/_codecs.pyi @@ -50,14 +50,14 @@ def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_16_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... +def utf_16_ex_decode(__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...) -> Tuple[Text, int, int]: ... def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_32_ex_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int, int]: ... +def utf_32_ex_decode(__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...) -> Tuple[Text, int, int]: ... def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... From dd9328d409dfa886f2eeed1528ff8129f4599c79 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 22 Jan 2020 12:10:54 -0800 Subject: [PATCH 4/5] _codecs: fix default value of charmap_encode --- stdlib/2and3/_codecs.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/_codecs.pyi b/stdlib/2and3/_codecs.pyi index 40afa562f8e7..6b2081f30424 100644 --- a/stdlib/2and3/_codecs.pyi +++ b/stdlib/2and3/_codecs.pyi @@ -33,7 +33,7 @@ def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... -def charmap_encode(__str: _Encodable, __errors: _Errors, __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ... def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... From ffe204c68e30e5fa2cd174e9e86f01bb16d92b6e Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 22 Jan 2020 12:16:21 -0800 Subject: [PATCH 5/5] _codecs: fix availability of charbuffer_encode --- stdlib/2and3/_codecs.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/_codecs.pyi b/stdlib/2and3/_codecs.pyi index 6b2081f30424..db622746dd6e 100644 --- a/stdlib/2and3/_codecs.pyi +++ b/stdlib/2and3/_codecs.pyi @@ -31,7 +31,8 @@ def charmap_build(__map: Text) -> _MapT: ... def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... -def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +if sys.version_info < (3, 2): + def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ...