class person():
def __init__(self,name,age,weight):
self.name = name
self.age = age
self.__weight = weight
def __cmp__(self):
pow_age = self.age.__pow__(2)
print(pow_age)
def __len__(self):
name_del = self.name.__len__()
print(name_del)
def __add__(self):
adds = self.age.__add__(self.__weight)
print(adds)
def infoma(self):
'''def doc example'''
print('%s is %s weights %s'%(self.name,self.age,self.__weight))
print(person.__class__) ## <class 'type'>
print(person.__repr__) ## <slot wrapper '__repr__' of 'object' objects>
person = person('bruce',25,60)
print(person) ## <__main__.person object at 0x000001F2CEFA8B70>
infoma = person.infoma() ## bruce is 25 weights 60
cmp = person.__cmp__() ## 625
lens = person.__len__() ## 5
adds = person.__add__() ## 85
print('doc is %s'%person.infoma.__doc__) ## doc is def doc example
print('dir is %s'%person.__dir__) ## dir is <built-in method __dir__ of person object at 0x0000020D2E0D8B70>
print('delatter is %s'%person.__delattr__) ## delatter is <method-wrapper '__delattr__' of person object at 0x0000020D2E0D8B70>
print('gt is %s'%person.__gt__) ## gt is <method-wrapper '__gt__' of person object at 0x0000020D2E0D8B70>
print('hash is %s'%person.__hash__) ## hash is <method-wrapper '__hash__' of person object at 0x0000020D2E0D8B70>
print('init is %s'%person.__init__) ## init is <bound method person.__init__ of <__main__.person object at 0x0000020D2E0D8B70>>
print('new is %s'%person.__new__) ## new is <built-in method __new__ of type object at 0x000000006427BD90>