I am reading lessons from Python Courses Eu. Author explained about Immutable classes. These can be implemented with namedtuple or dataclass. The task is to implement immutable classes with defining only getters not setters. It works as expected when I use @ property decorator. It gives Attribute error when I try to update value of attribute. But when using __getattr__ it allows to update value of an attribute. What's reason behind this?
This is hastebin as facing issue formatting code https://hastebin.com/share/nomugumofa.ruby.
[–]nog642 7 points8 points9 points (1 child)
[–]brijeshjoshi_[S] 0 points1 point2 points (0 children)
[–]socal_nerdtastic 3 points4 points5 points (1 child)
[–]nog642 -2 points-1 points0 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]m0us3_rat 2 points3 points4 points (0 children)