PaiGram/utils/typedefs.py

24 lines
598 B
Python
Raw Normal View History

from pathlib import Path
from types import TracebackType
2022-09-17 16:28:51 +00:00
from typing import Any, Dict, Optional, Tuple, Type, Union
from httpx import URL
__all__ = [
'StrOrPath', 'StrOrURL', 'StrOrInt',
2022-09-10 14:46:08 +00:00
'SysExcInfoType', 'ExceptionInfoType',
'JSONDict', 'JSONType'
]
StrOrPath = Union[str, Path]
2022-09-17 16:28:51 +00:00
StrOrURL = Union[str, URL]
StrOrInt = Union[str, int]
2022-09-10 14:46:08 +00:00
SysExcInfoType = Union[
Tuple[Type[BaseException], BaseException, Optional[TracebackType]],
Tuple[None, None, None]
]
ExceptionInfoType = Union[bool, SysExcInfoType, BaseException]
JSONDict = Dict[str, Any]
JSONType = Union[JSONDict, list]