__getattriute__】的更多相关文章

# class Foo: # def __init__(self,x): # self.x = x # def __getattr__(self,item): # print("__getattr__") # # return self.__dict__[item] # def printer(self): # print("lsdajfl") # # f1 = Foo(10) # print(f1.x) # f1.abc # 访问不存在的属性,触发__getatt…
目录: isinstance(obj,cls)和issubclass(sub,super) 反射 __setattr__,__delattr__,__getattr__ 二次加工标准类型(包装) __getattribute__ 描述符(__get__,__set__,__delete__) property __setitem__,__getitem,__delitem__ __str__,__repr__,__format__ __slots__ __next__和__iter__实现迭代器…