3 ms·
> The purpose is you want to use code in other modules. So put them in the same module? Circular modules don’t give you the benefits of modules, do they? Not a
by chrisseaton 5y ago
> The purpose is you want to use code in other modules.
So put them in the same module? Circular modules don’t give you the benefits of modules, do they? Not an expert in modularity.
- BurningFrog 5y agoPutting all your code in one file does indeed solve all import problems, but creates far bigger ones. In case you didn't know, each source code file is a module in Python.
- maleldil 5y agoIf you have A -> B -> C -> A, then you need all three of A, B and C to be defined if you're going to use any one of those modules. When that's the case, the only thing you're gaining by using modules is the organisation of the file.
- BurningFrog 5y agoSure, but organizing code in files is one of the most important parts of programming!