call和run的区别
class ThreadFunc(object):def __init__(self, func, args, name=''):
self.name = name
self.func = func
self.args = args
def __call__(self):
apply(self.func, self.args)
class MyThread(threading.Thread):
def __init__(self, func, args, name=''):
threading.Thread.__init__(self)
self.name = name
self.func = func
self.args = args
def run(self):
apply(self.func, self.args)
哪位大侠解释下这两个类怎样移植到python3,而且特殊方法call和run有啥区别呢?
页:
[1]