-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathheader.pyi
31 lines (28 loc) · 1.21 KB
/
header.pyi
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
from collections.abc import Iterable
from email.charset import Charset
from typing import Any
__all__ = ["Header", "decode_header", "make_header"]
class Header:
def __init__(
self,
s: bytes | bytearray | str | None = ...,
charset: Charset | str | None = ...,
maxlinelen: int | None = ...,
header_name: str | None = ...,
continuation_ws: str = ...,
errors: str = ...,
) -> None: ...
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ...
def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, __other: object) -> bool: ...
# decode_header() either returns list[tuple[str, None]] if the header
# contains no encoded parts, or list[tuple[bytes, str | None]] if the header
# contains at least one encoded part.
def decode_header(header: Header | str) -> list[tuple[Any, Any | None]]: ...
def make_header(
decoded_seq: Iterable[tuple[bytes | bytearray | str, str | None]],
maxlinelen: int | None = None,
header_name: str | None = None,
continuation_ws: str = " ",
) -> Header: ...