codekingpro/portable-devtools
114k
1from __future__ import annotations2 3import sys4from typing import Protocol5 6if sys.version_info < (3, 12):7 from typing_extensions import Buffer8else:9 from collections.abc import Buffer10 11 12class Decode(Protocol):13 __name__: str14 __module__: str15 16 def __call__(17 self, s: str | Buffer, altchars: str | Buffer | None = None, validate: bool = False18 ) -> bytes: ...19 20 21class Encode(Protocol):22 __name__: str23 __module__: str24 25 def __call__(self, s: Buffer, altchars: Buffer | None = None) -> bytes: ...26 27 28class EncodeBytes(Protocol):29 __name__: str30 __module__: str31 32 def __call__(self, s: Buffer) -> bytes: ...33 34 35__all__ = ("Buffer", "Decode", "Encode", "EncodeBytes")36 