mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
add (overwrite with) mypy stubs, if available
This commit is contained in:
31
stdlib/3/codecs.pyi
Normal file
31
stdlib/3/codecs.pyi
Normal 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]:
|
||||
...
|
||||
Reference in New Issue
Block a user