For example, I have a class:
import datetime
class Obj:
def __init__(self, attribute_1):
self.attribute_1 = attribute_1
self.last_edited = None
I want it to be able to do this:
# Creating object
obj1 = Obj("a")
obj1.attribute_1 = "b" # obj1.last_edited should have changed to datetime.datetime.now()
I'm not sure how to implement the changing of obj1's 'last_edited' attribute if I were to directly change obj1's 'attribute_1' (without any setters).
Thanks in advance.