mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
split _codecs into Python 2 and Python 3 versions.
This commit is contained in:
51
builtins/3/_codecs.pyi
Normal file
51
builtins/3/_codecs.pyi
Normal file
@@ -0,0 +1,51 @@
|
||||
"""Stub file for the '_codecs' module."""
|
||||
|
||||
from typing import Any, AnyStr, Callable, Tuple, Optional
|
||||
|
||||
import codecs
|
||||
|
||||
# For convenience:
|
||||
_Handler = Callable[[Exception], Tuple[str, int]]
|
||||
|
||||
def register(search_function: Callable[[str], Any]) -> None: ...
|
||||
def register_error(errors: str, handler: _Handler) -> None: ...
|
||||
def lookup(a: str) -> codecs.CodecInfo: ...
|
||||
def lookup_error(a: str) -> _Handler: ...
|
||||
def decode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
|
||||
def encode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
|
||||
def charmap_build(a: str) -> Dict[int, int]: ...
|
||||
|
||||
def ascii_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def ascii_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def charbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
|
||||
def charmap_decode(data: AnyStr, errors: str = ..., mapping: Optional[Dict[int, int]] = ...) -> Tuple[str, int]: ...
|
||||
def charmap_encode(data: AnyStr, errors: str, mapping: Optional[Dict[int, int]] = ...) -> Tuple[bytes, int]: ...
|
||||
def escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def latin_1_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def latin_1_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def raw_unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def raw_unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def readbuffer_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def unicode_internal_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_internal_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_7_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_7_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_8_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_8_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
Reference in New Issue
Block a user