You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you reporting a bug, or opening a feature request?
Bug
Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to simplify your case to a minimal repro.
# a.pyimportsysthis=sys.modules[__name__]
this.serializable_classes= {} # a.py:15: error: Module has no attribute "serializable_classes"setattr(this, "serializable_classes", {}) # alternative without mypy error
What is the actual behavior/output?
error: Module has no attribute "serializable_classes"
What is the behavior/output you expect?
No error. It seems mypy applies rules for accessing a name from a module, while it really is an assignment. Why would the previous presence of a variable name in a module namespace matter under these circumstances?
What are the versions of mypy and Python you are using?
Please provide more information to help us understand the issue:
mypy
reports an error on this, which I believe may be unnecessary.error: Module has no attribute "serializable_classes"
mypy
applies rules for accessing a name from a module, while it really is an assignment. Why would the previous presence of a variable name in a module namespace matter under these circumstances?The text was updated successfully, but these errors were encountered: