Closed
Description
Running mypy on the following class, using Python 3.6 support (PEP 526):
class TestClass:
a: str = 9
def __init__(self):
self.b: str = 8
self.b = 12
def test_method(self):
self.b = 50
Results in the following output:
another_test.py: note: In class "TestClass":
another_test.py:3: error: Incompatible types in assignment (expression has type "int", variable has type "str")
It seems as if the type of the member variable b
is not checked.
Metadata
Metadata
Assignees
Labels
No labels