python特性002:特性是可继承的
#!/usr/local/python3.5/bin/python3 class Person(object):
def __init__(self,name):
self.name=name
def get_name(self):
print('this is get name')
return self.name
def set_name(self,name):
print('this is set name')
self.name=name
def del_name(self):
print('this is del name')
del self.name
Name = property(get_name,set_name,del_name,'name property ...') class Manager(Person):
pass if __name__=="__main__":
jlx=Manager('Jianglexing')
print(jlx.Name)