class Student(object):
def __getattr__(self, attr): if attr=='age': return lambda: 25
s.age() Traceback (most recent call last): File "<pyshell#115>", line 1, in <module> s.age() TypeError: 'NoneType' object is not callable
Sign in to make a reply
为享受人生而活着
class Student(object):