_typing_compat.pyi 469 B

123456789101112131415
  1. from typing import Any, ClassVar, Protocol
  2. # MYPY is a special constant in mypy which works the same way as `TYPE_CHECKING`.
  3. MYPY = False
  4. if MYPY:
  5. # A protocol to be able to statically accept an attrs class.
  6. class AttrsInstance_(Protocol):
  7. __attrs_attrs__: ClassVar[Any]
  8. else:
  9. # For type checkers without plug-in support use an empty protocol that
  10. # will (hopefully) be combined into a union.
  11. class AttrsInstance_(Protocol):
  12. pass