add (overwrite with) mypy stubs, if available

This commit is contained in:
Matthias Kramm
2015-09-30 07:36:12 -07:00
parent 69e10b3aed
commit 337abed05a
432 changed files with 22360 additions and 776 deletions

31
stdlib/3/codecs.pyi Normal file
View File

@@ -0,0 +1,31 @@
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]:
...