email: improve bytes handling (#9032)

This commit is contained in:
Jelle Zijlstra
2022-11-01 02:13:30 -07:00
committed by GitHub
parent 3e46f9a9ee
commit 7ab933f3c3
10 changed files with 26 additions and 19 deletions

View File

@@ -1,9 +1,13 @@
__all__ = ["body_decode", "body_encode", "decode", "decodestring", "header_encode", "header_length"]
def header_length(bytearray: str | bytes) -> int: ...
def header_encode(header_bytes: str | bytes, charset: str = ...) -> str: ...
def body_encode(s: bytes, maxlinelen: int = ..., eol: str = ...) -> str: ...
def decode(string: str | bytes) -> bytes: ...
from _typeshed import ReadableBuffer
def header_length(bytearray: str | bytes | bytearray) -> int: ...
def header_encode(header_bytes: str | ReadableBuffer, charset: str = ...) -> str: ...
# First argument should be a buffer that supports slicing and len().
def body_encode(s: bytes | bytearray, maxlinelen: int = ..., eol: str = ...) -> str: ...
def decode(string: str | ReadableBuffer) -> bytes: ...
body_decode = decode
decodestring = decode