Files
typeshed/stdlib/3/codecs.pyi
2015-09-30 09:59:44 -07:00

32 lines
879 B
Python

from typing import Any, BinaryIO, Callable, IO
BOM_UTF8 = b''
class Codec: ...
class StreamWriter(Codec): ...
class CodecInfo(tuple):
def __init__(self, *args) -> None: ...
def register(search_function: Callable[[str], CodecInfo]) -> None:
...
def register_error(name: str, error_handler: Callable[[UnicodeError], Any]) -> None: ...
def lookup(encoding: str) -> CodecInfo:
...
# TODO This Callable is actually a StreamWriter constructor
def getwriter(encoding: str) -> Callable[[BinaryIO], StreamWriter]: ...
class IncrementalDecoder:
errors = ... # type: Any
def __init__(self, errors=''): ...
def decode(self, input, final=False): ...
def reset(self): ...
def getstate(self): ...
def setstate(self, state): ...
def open(filename: str, mode: str='rb', encoding: str=None, errors: str='strict', buffering: int=1) -> IO[Any]:
...