4 ms·
Circular imports often indicate an architectural issue. In any case, there are easy solutions in the rare cases where it's absolutely necessary, like putting on
by saila 5y ago
Circular imports often indicate an architectural issue. In any case, there are easy solutions in the rare cases where it's absolutely necessary, like putting one of the imports at the bottom of one of the modules or in a function.
Regarding configuration based loading, that's something that's pretty common in Python webapps, and injecting capabilities/services per request seems like it would be pretty straightforward (and not anti-Pythonic either, depending on the implementation).
I just don't see how Python makes this kind of thing more or less difficult than other languages.
- bshipp 5y agoCircular imports also are most common when you use 'from module import *'.