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
):
...: return self
.width
, self
.height
...: def delsize(self
):
...: self
.width
, self
.height
= 0, 0
...: size
= property(getsize
, setsize
, delsize
, '用
...: 于描述矩形大小的属性'
)
...:
转载请注明原文地址: https://mac.8miu.com/read-516740.html