Debian Codegraph @

third_party/python/attrs/attr/_typing_compat.pyi

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