I am working on a program in Python (with Pycharm), where about half of the code is taken up by classes and functions. The program is now quite long and it is written in a single file. A lot of time would be saved if I could divide the classes, functions, and the rest of the code into 3 separate files. At the moment I can’t do that due to circular imports, which causes the statement “from FunctionDocument import * ” to not work when written in the main document.
I am aware that circular imports is unprofessional and unrecommended. But it makes no sense to me why it would NOT be possible to simply add one or two lines that instructs Python to treat 3 separate files as if they were all written in a single one - EVEN if they depend on each other.
I know that this can be solved by rewriting the code to make it non-circular, and that creating a Viritual Environment might also solve the problem. But is there really no other way?