After updating to mypy 0.530, I am getting an error on a __getattr__() method defined on a class:
$ mypy --version
mypy 0.530
$ python3 --version
Python 3.6.3
[~/cretonne/lib/cretonne/meta]
$ cat mypy.ini
[mypy]
disallow_untyped_defs = True
warn_unused_ignores = True
warn_return_any = True
[~/cretonne/lib/cretonne/meta]
$ mypy cdsl/formats.py
cdsl/formats.py:143: error: __getattr__ is not valid at the module level outside a stub file
I don't have any module level __getattr__() functions.
This didn't reproduce with a smaller test case, but you can check out the Cretonne repo to reproduce.