运行报错,我用的是python3.x
TypeError: 'NoneType' object is not callable
class Programer(object): hobby = "Play Computer" def __init__(self,name,age,weight): self.name = name self._age = age self.__weight = weight @classmethod def get_hobby(cls): return cls.hobby @property def get_infor(self): print("my name is hh") def get_weight(self): return self.__weight class BackenProgramer(Programer): def __init__(self,name,age,weight,languge): super(BackenProgramer,self).__init__(name,age,weight) self.languge = languge def get_infor(self): print("hh is my name") def intudece(programer): if isinstance(programer,Programer): programer.get_infor() if __name__=="__main__": programer = Programer('Alb',28,90) bcprogramer = BackenProgramer('Alber',25,80,'python') #print (dir(programer)) #print (programer.__dict__) #print (BackenProgramer.get_hobby()) #programer.get_infor #print (isinstance(programer,Programer)) intudece(programer) bcprogramer.get_infor