class PerInstancePropertyProxy(object):

    def __init__(self, prop):
        self.prop = prop

def __get__(self, instance, owner):
    if instance is None:
        return self
return instance.__dict__[self.prop].__get__(instance, owner)

def __set__(self, instance, value):
    instance.__dict__[self.prop].__set__(instance, value)


class Prop(object):

    def __init__(self, value, multiplier):
        self.value = value
self.multiplier = multiplier

def __get__(self, instance, owner):
    if instance is None:
        return self
return self.value * self.multiplier

def __set__(self, instance, value):
    self.value = value


class Obj(object):
    val = PerInstancePropertyProxy('val')

def __init__(self):
    self.__dict__['val'] = Prop(1.0, 10.0)

def prop(self, attr_name):
    return self.__dict__[attr_name]
Дескрипторы как атрибуты экземпляра в python