In [ 8 ]: class Rectangle : ... : def __init__ ( self , width , height ): ... : self . width = width ... : self . height = height ... : def setsize ( self , size ): ... : self . width , self . height = size ... : def getsize ( self ): ... :
...: def __init__(self, width, height):
...: self.width = width
...: self.height = height
...: def setsize(self, size):
...: self.width, self.height = size
...: def getsize(self):
...: return self.width, self.height
...: def delsize(self):
...: self.width, self.height = 0, 0
...: size = property(getsize, setsize, delsize, '用
...: 于描述矩形大小的属性')
...: