python self对象

[root@centos6 tmp]# cat a3.py 
class Person:
    def __init__(self,id,mail,phone):
        print(type(self))
        print(dir(self))
        self.id=id
        self.mail=mail
        self.phone=phone

    def send_xypp(self):
        self.xxx='444445555'
        return(self.id)

    def send_mail(self):
        return(self.mail)
    def send_phone(self):
        return(self.phone)

person_inst=Person('11111','222222222222','3333333333')
print(type(person_inst))
print(dir(person_inst))
[root@centos6 tmp]# python a3.py 

['__doc__', '__init__', '__module__', 'send_mail', 'send_phone', 'send_xypp']

['__doc__', '__init__', '__module__', 'id', 'mail', 'phone', 'send_mail', 'send_phone', 'send_xypp']
[root@centos6 tmp]# 

你可能感兴趣的:(python,高级编程,python,开发语言)