利用描述符原理完成自定制@property、@classmethod、@staticmethod

1、@propertypython class Lazyproperty: def __init__(self,func): self.func=func def __get__(self, instance, owner): print('这是咱们本身定制的静态属性,r1.area实际是要执行r1.area()') if insta
相关文章
相关标签/搜索