class Rectangle(object): def __init__(self): self.width = 0 self.height = 0 def setSize(self, size): self.width, self.height = size def getSize(self): return self.width, self.height size = property(getSize, setSize)r = Rectangle()r.width = 10r.height = 5print r.sizer.size = 150, 100print r.width
Name (required)
email (will not be published) (required)
Website