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