Closed
Description
To repro (I'm using mypy 0.660):
In models/__init__.py
:
config = object()
from .user import User
In models/user.py
:
from . import config
print(config)
class User: ...
It runs fine:
~/tmp/repro$ python3 -c 'import models'
<object object at 0x10eccb1c0>
But mypy fails:
~/tmp/repro$ mypy -m models
models/user.py:2: error: Cannot determine type of 'config'
There are two issues here (I'm happy to file another one to track them separately if that helps):
- This should probably be supported by mypy
- Regardless of whether this particular case is fixed, the error message should say something about import cycles (looks like there have been several issues similar to this in the past; this probably won't be the last)