-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathheader.pyi
More file actions
32 lines (29 loc) · 1.3 KB
/
header.pyi
File metadata and controls
32 lines (29 loc) · 1.3 KB
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
from collections.abc import Iterable
from email.charset import Charset
from typing import Any, ClassVar
__all__ = ["Header", "decode_header", "make_header"]
class Header:
def __init__(
self,
s: bytes | bytearray | str | None = None,
charset: Charset | str | None = None,
maxlinelen: int | None = None,
header_name: str | None = None,
continuation_ws: str = " ",
errors: str = "strict",
) -> None: ...
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ...
def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ...
__hash__: ClassVar[None] # type: ignore[assignment]
def __eq__(self, other: object) -> bool: ...
def __ne__(self, value: 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: ...