typing.py 578 B

12345678910111213141516171819202122232425
  1. import sys
  2. from typing import Any, AsyncGenerator, Generator, NewType, Tuple, Union, List, Dict, Type, IO
  3. from PIL.Image import Image
  4. if sys.version_info >= (3, 8):
  5. from typing import TypedDict
  6. else:
  7. from typing_extensions import TypedDict
  8. SHA256 = NewType('sha_256_hash', str)
  9. CreateResult = Generator[str, None, None]
  10. AsyncResult = AsyncGenerator[str, None]
  11. Messages = List[Dict[str, str]]
  12. ImageType = Union[str, bytes, IO, Image, None]
  13. __all__ = [
  14. 'Any',
  15. 'AsyncGenerator',
  16. 'Generator',
  17. 'Tuple',
  18. 'TypedDict',
  19. 'SHA256',
  20. 'CreateResult',
  21. ]