class Work(object): def __init__(self, time=30): self.time = time w = Work() print(callable(w))结果为False
类的实例对象前提是类中实现了__call__方法才是可调用的
在类中:
__init__()的作用是初始化某个类的一个实例。 __call__()的作用是使实例能够像函数一样被调用
__init__()
__call__()