typing.py 834 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import sys
  2. from typing import Any, AsyncGenerator, Generator, NewType, Tuple, Union, List, Dict, Type, IO, Optional
  3. try:
  4. from PIL.Image import Image
  5. except ImportError:
  6. from typing import Type as Image
  7. if sys.version_info >= (3, 8):
  8. from typing import TypedDict
  9. else:
  10. from typing_extensions import TypedDict
  11. SHA256 = NewType('sha_256_hash', str)
  12. CreateResult = Generator[str, None, None]
  13. AsyncResult = AsyncGenerator[str, None]
  14. Messages = List[Dict[str, str]]
  15. Cookies = Dict[str, str]
  16. ImageType = Union[str, bytes, IO, Image, None]
  17. __all__ = [
  18. 'Any',
  19. 'AsyncGenerator',
  20. 'Generator',
  21. 'Tuple',
  22. 'Union',
  23. 'List',
  24. 'Dict',
  25. 'Type',
  26. 'IO',
  27. 'Optional',
  28. 'TypedDict',
  29. 'SHA256',
  30. 'CreateResult',
  31. 'AsyncResult',
  32. 'Messages',
  33. 'Cookies',
  34. 'Image',
  35. 'ImageType'
  36. ]