Circular imports in Python can lead to suddenly appearing bugs.
I guess it should be quite easy to detect them automatically:
- Import all code
- Build a graph
- Check for cycles.
Lazy imports which happen during run time are out of the scope of this question.
Does anybody know a tool which can detect circular imports in Python?