Closed
Description
Support overloading attribute access by defining a __getattr__
method. If a class has a __getattr__
method, mypy should let programs access any attributes, and the type would be the return type of __getattr__
. Example:
class A:
def __getattr__(self, name: str) -> int: return 2
a = A()
print(a.foobar) # okay, type is int