SIMNet/simnet/utils/types.py
洛水居室 15c7228e2c
🎨 Add URLTypes
2023-06-12 10:59:36 +08:00

30 lines
818 B
Python

from typing import TypeVar, Union, Mapping, Optional, Sequence, Dict, List, Tuple, Any
RT = TypeVar("RT", bound="BaseClient")
URLTypes = Union["URL", str]
CookieTypes = Union["Cookie", Dict[str, str], List[Tuple[str, str]]]
RequestData = Mapping[str, Any]
PrimitiveData = Optional[Union[str, int, float, bool]]
QueryParamTypes = Union[
"QueryParams",
Mapping[str, Union[PrimitiveData, Sequence[PrimitiveData]]],
List[Tuple[str, PrimitiveData]],
Tuple[Tuple[str, PrimitiveData], ...],
str,
bytes,
]
HeaderTypes = Union[
"Headers",
Mapping[str, str],
Mapping[bytes, bytes],
Sequence[Tuple[str, str]],
Sequence[Tuple[bytes, bytes]],
]
TimeoutTypes = Union[
Optional[float],
Tuple[Optional[float], Optional[float], Optional[float], Optional[float]],
"Timeout",
]