by lopz · 3y ago · 0 comments
if TYPE_CHECKING: import WhateverClass
https://docs.python.org/3/library/typing.html#typing.TYPE_CH...
(And some types are defined in the typeshed so only exist to be imported during type checking; eg the type checker lib itself is a dependency in this case)