为了将类的实例对象变为可调用对象
class People(object):
def __init__(self):
pass
def __call__(self,name):
print("People::__call__()",name)
p = People()
print(callable(p))
p("mandy")
p.__call__("mandy")
p("mandy") 其实跟p.__call__("mandy")是一抹一样的