为什么最后会打印出None
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_weight(self):
return self.__weight
def self_introduction(self):
print "My name is %s \n I'm %d years old"%(self.name,self._age)
if __name__ == "__main__":
programer = Programer("Albert",25,80)
print dir(programer)
print programer.__dict__
print Programer.get_hobby()
print programer.get_weight
print programer.self_introduction()