Closed
Description
It's sometimes painful to work around issues related to circular module dependencies. Some examples:
- Mypy complains about not being able to infer a type because of a circular dependency.
- Mypy type checks okay but at runtime something is undefined because of a circular dependency.
- A type annotation introduces a circular module dependency where there was none before.
Not sure how these should be resolved. Some ideas:
- Add a flag that dumps information about any circular module dependencies in the target program. This should help with debugging.
- Warn about 'from imports' that are part of a circular module dependency, as these could fail at runtime.