aio-libs / aiohttp
1 10
import json
2 10
import os
3 10
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, Tuple, Union
4

5 10
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy, istr
6 10
from yarl import URL
7

8 10
DEFAULT_JSON_ENCODER = json.dumps
9 10
DEFAULT_JSON_DECODER = json.loads
10

11
if TYPE_CHECKING:  # pragma: no cover
12
    _CIMultiDict = CIMultiDict[str]
13
    _CIMultiDictProxy = CIMultiDictProxy[str]
14
    _MultiDict = MultiDict[str]
15
    _MultiDictProxy = MultiDictProxy[str]
16
    from http.cookies import BaseCookie, Morsel
17
else:
18 10
    _CIMultiDict = CIMultiDict
19 10
    _CIMultiDictProxy = CIMultiDictProxy
20 10
    _MultiDict = MultiDict
21 10
    _MultiDictProxy = MultiDictProxy
22

23 10
Byteish = Union[bytes, bytearray, memoryview]
24 10
JSONEncoder = Callable[[Any], str]
25 10
JSONDecoder = Callable[[str], Any]
26 10
LooseHeaders = Union[Mapping[Union[str, istr], str], _CIMultiDict, _CIMultiDictProxy]
27 10
RawHeaders = Tuple[Tuple[bytes, bytes], ...]
28 10
StrOrURL = Union[str, URL]
29

30 10
LooseCookiesMappings = Mapping[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]]
31 10
LooseCookiesIterables = Iterable[
32
    Tuple[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]]
33
]
34 10
LooseCookies = Union[
35
    LooseCookiesMappings,
36
    LooseCookiesIterables,
37
    "BaseCookie[str]",
38
]
39

40

41 10
PathLike = Union[str, "os.PathLike[str]"]

Read our documentation on viewing source code .

Loading