Open ramkumarhn opened 5 years ago
from typing import NamedTuple class Car(NamedTuple): color: str mileage: float automatic: bool car1 = Car('red', 3812.3, True) car1.mileage = 12
Currently, at runtime the below exception is thrown. car1.mileage = 12 AttributeError: can't set attribute
car1.mileage = 12
AttributeError: can't set attribute
This error should be flagged
pylint 2.3.1 astroid 2.2.5 Python 3.7.2 (default, Jan 13 2019, 12:50:01) [Clang 10.0.0 (clang-1000.11.45.5)]
Thanks @ramkumarhn We should add a rule for this as well.
Steps to reproduce
Current behavior
Currently, at runtime the below exception is thrown.
car1.mileage = 12
AttributeError: can't set attribute
Expected behavior
This error should be flagged
pylint --version output
pylint 2.3.1 astroid 2.2.5 Python 3.7.2 (default, Jan 13 2019, 12:50:01) [Clang 10.0.0 (clang-1000.11.45.5)]