KEMBAR78
Class level __getattr__ causes error: __getattr__ is not valid at the module level outside a stub file · Issue #4069 · python/mypy · GitHub
Skip to content

Class level __getattr__ causes error: __getattr__ is not valid at the module level outside a stub file #4069

@stoklund

Description

@stoklund

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions