#__init__(self)在构造一个实例时自动调用
#__del__(self)在删除一个实例时自动调用
#__repr__(self):在使用repr()时自动调用,一般用来返回一个与eval()兼容的对象字符串表达式来重建对象
#__str__(self):在进行向string转换时自动调用
#__cmp__(self,other): 执行比较时调用:0表示相等;1表示大于;-1表示小于
#__nozero__(self):执行真假判断时自动调用:0表示假,1表示真
#__len__(self):执行len(obj)时自动调用,一般返回对象的长度,否则将会导致异常
#__getitem__(self,key):self[key]时自动调用,用来模拟list[key],dictionary[key],tuple[key]等数据结构,常常在使用for 或者while的循环中使用来遍历自定义对象
#__setitem__(self,key,value):在obj[key]=value时自动调用
#__delitem__(self,key):在执行del obj[key] 时自动调用
#__delattr__ 客户删除一个属性时执行(例如 del anObject.attribute)
#__getattr__ 客户访问一个属性名,但在对象__dict__属性中找不到这个名称时执行(例如anObject.unfoundName)
#__setattr__ 客户将值指派给对象的属性时执行(例如 anObject.attribute = value)
#与__*item类似__getslice__(self,i,j)和setslice__(self,i,j,value)以及__delsclice__(self,i,j)用来进行切片操作
#__contains__(self,other):使object 与equence 一样可以处理in语句
#__call__(self,arg1,arg2,...):让对象的实例可以像函数一样,可以进行调用,如对象A有该函数的定义则可以如此使用:
#a=A()
#a("hello","World")
#hello
#World
"""
__add__(self,other) self + other
__sub__(self,other) self - other
__mul__(self,other) self * other
__div__(self,other) self / other
__mod__(self,other) self % other
__divmod__(self,other) divmod(self,other)
__pow__(self,other) self ** other
__pow__(self,other,modulo) pow(self,other,modulo)
__lshift__(self,other) self << other
__rshift__(self,other) self >> other
利用类的每个实例共享相同的__class__属性来实现静态成员变量