File: charmap.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 28,756 kB
  • sloc: python: 7,741; makefile: 20; sh: 18
file content (33 lines) | stat: -rw-r--r-- 1,652 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import codecs
from _codecs import _CharMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
    # At runtime, this is codecs.charmap_encode
    @staticmethod
    def encode(str: str, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[bytes, int]: ...
    # At runtime, this is codecs.charmap_decode
    @staticmethod
    def decode(data: ReadableBuffer, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
    mapping: _CharMap | None
    def __init__(self, errors: str = "strict", mapping: _CharMap | None = None) -> None: ...
    def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
    mapping: _CharMap | None
    def __init__(self, errors: str = "strict", mapping: _CharMap | None = None) -> None: ...
    def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter):
    mapping: _CharMap | None
    def __init__(self, stream: codecs._WritableStream, errors: str = "strict", mapping: _CharMap | None = None) -> None: ...
    def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...  # type: ignore[override]

class StreamReader(Codec, codecs.StreamReader):
    mapping: _CharMap | None
    def __init__(self, stream: codecs._ReadableStream, errors: str = "strict", mapping: _CharMap | None = None) -> None: ...
    def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ...  # type: ignore[override]

def getregentry() -> codecs.CodecInfo: ...