# Descriptor example
class Desc:
def __get__ (self, ins, cls):
return ins.side*ins.side
def __set__ (self, ins, val):
ins.side = sqrt (val)
class Square:
area = Desc ()
def __init__ (self, side):
self.side = side
s = Square (4)
print (s.area)
s.area = 25
print (s.side)