Python 内置函数 发表于 2017-10-20 | 分类于 python , magic call()12345678910111213class DistanceForm(object): def __init__(self, origin): self.origin = origin print "origin :"+str(origin) def __call__(self, x): print "x :"+str(x) p = DistanceForm(100)p(2000) 输出 origin :100x :2000