I've this descriptor:
# Generic descriptor
class Attribute(object):
def __init__(self, value):
self.value = value
def __get__(self, instance, value):
return self.value
def __set__(self, instance, value):
self.value = value
I would add an attribute 'modified' to check if an instance of descriptor is modified. Es.
# Generic descriptor
class Attribute(object):
def __init__(self, value):
self.value = value
self.modified = False
def __get__(self, instance, value):
return self.value
def __set__(self, instance, value):
self.value = value
self.modified = True
How I can do this ?