1. 首页
  2. 数据库
  3. 其它
  4. Python object类中的特殊方法代码讲解

Python object类中的特殊方法代码讲解

上传者: 2020-12-23 01:41:06上传 PDF文件 74.1KB 热度 12次
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
下载地址
用户评论