|
| 1 | +import codecs |
| 2 | +from collections.abc import Iterable, Iterator |
| 3 | +from typing import Final |
| 4 | + |
| 5 | +VERSION: Final[str] |
| 6 | +PYTHON_NAMES: Final[dict[str, str]] |
| 7 | +CACHE: dict[str, Encoding] |
| 8 | + |
| 9 | +def ascii_lower(string: str) -> str: ... |
| 10 | +def lookup(label: str) -> Encoding | None: ... |
| 11 | + |
| 12 | +class Encoding: |
| 13 | + name: str |
| 14 | + codec_info: codecs.CodecInfo |
| 15 | + def __init__(self, name: str, codec_info: codecs.CodecInfo) -> None: ... |
| 16 | + |
| 17 | +UTF8: Final[Encoding] |
| 18 | + |
| 19 | +def decode(input: bytes | bytearray, fallback_encoding: str | Encoding, errors: str = "replace") -> tuple[str, Encoding]: ... |
| 20 | +def encode(input: str, encoding: str | Encoding = ..., errors: str = "strict") -> bytes: ... |
| 21 | +def iter_decode( |
| 22 | + input: Iterable[bytes | bytearray], fallback_encoding: str | Encoding, errors: str = "replace" |
| 23 | +) -> tuple[Iterator[Encoding | str], Encoding]: ... |
| 24 | +def iter_encode(input: Iterable[str], encoding: str | Encoding = ..., errors: str = "strict") -> Iterator[bytes]: ... |
| 25 | + |
| 26 | +class IncrementalDecoder: |
| 27 | + encoding: Encoding | None |
| 28 | + def __init__(self, fallback_encoding: str | Encoding, errors: str = "replace") -> None: ... |
| 29 | + def decode(self, input: bytes | bytearray, final: bool = False) -> str: ... |
| 30 | + |
| 31 | +class IncrementalEncoder: |
| 32 | + encode: bytes |
| 33 | + def __init__(self, encoding: str | Encoding = ..., errors: str = "strict") -> None: ... |
0 commit comments