摘要:
country = '澳大利亚' class Chinese: country = '中国' def __init__(self,name): self.name = name print('------>',country) #既不是类属性,也不是实例属性,根据作用域原则查找 print('------>',self.cou... 阅读全文
摘要:
__contains__():当使用in,not in 对象的时候 调用(not in 是在in完成后再取反,实际上还是in操作) __reversed__():当使用reversed函数翻转对象时调用 __len__():当使用len(A)该对象时调用该方法,当没有该方法是会报错,且返回数据不为整 阅读全文