Closed
Description
Let's say I have the following code in example.py
:
class Example:
def __init__(self) -> None:
setattr(self, 'name', 'value')
def a_function(self) -> bool:
return self.name == 'value'
e = Example()
print(e.a_function())
When I run mypy example.py
, I get:
example.py:6: error: "Example" has no attribute "name"
Is this expected behavior?
Metadata
Metadata
Assignees
Labels
No labels