Python object类中的特殊方法代码讲解
python版本:3.8 class object: """ The most base type """ # del obj.xxx或delattr(obj,'xxx')时被调用,删除对象中的一个属性 def __delattr__(self, *args, **kwargs): # real signature unknown """ Implement delattr(self, name). """ pass # 对应dir(obj),返回一个列表,其中包含所有属性和方法名(包含特殊方法) def __dir__(self, *args, **kwargs): # re
下载地址
用户评论