Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I eventually also found out that the typing module has a global variable TYPE_CHECKING that can be used to only import during type-checking. Concretely, the following code for helpers.py seems to ...
Answer
#1: Initial revision
I eventually also found out that the `typing` module has a global variable [`TYPE_CHECKING`](https://docs.python.org/3/library/typing.html#typing.TYPE_CHECKING) that can be used to only import during type-checking. Concretely, the following code for `helpers.py` seems to type-check fine as well. ```python from typing import TYPE_CHECKING if TYPE_CHECKING: from process import Process class Helper: def update(self, process: "Process"): ... ``` The [other answer](https://software.codidact.com/posts/289455/289481#answer-289481) probably is the better way to go in the context of circular imports, since this functionality is mainly intended for costly imports (according to the docs).