I am writing in python 3.5, I try to use typing, but I ran into the problem of cyclic import - it became difficult to break the program into modules.
One of the problems is one_to one:
# модуль 1 from mod1 import B class A: def __init__(self): self.__B = B(self) # модуль 2 from mod2 import A class B: def __init__(self, arg: A): self.__a = arg
Well, and so on. The problem is seriously increasing with the increase in the number of modules.
I want to know if I approach the task incorrectly, or is there a solution to the problem?
PS: I am in the sense that the ImportError exception is raised, and I cannot get rid of it.