quopri: improve types (#9074)

This commit is contained in:
Jelle Zijlstra
2022-11-03 03:37:59 -07:00
committed by GitHub
parent 22c5afa2d2
commit 82bf494534

View File

@@ -1,8 +1,11 @@
from typing import BinaryIO
from _typeshed import ReadableBuffer, SupportsNoArgReadline, SupportsRead, SupportsWrite
from typing import Protocol
__all__ = ["encode", "decode", "encodestring", "decodestring"]
def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ...
def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ...
def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ...
def decodestring(s: bytes, header: int = ...) -> bytes: ...
class _Input(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ...
def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: int = ...) -> None: ...
def encodestring(s: ReadableBuffer, quotetabs: int = ..., header: int = ...) -> bytes: ...
def decode(input: _Input, output: SupportsWrite[bytes], header: int = ...) -> None: ...
def decodestring(s: str | ReadableBuffer, header: int = ...) -> bytes: ...