不知何故,这在 Maya/Python 脚本编辑器中运行良好,但在我的模块代码中时会失败。有人有想法么?
class ControlShape(object):
def __init__(self, *args, **kwargs):
print 'Inside ControlShape...'
class Cross(ControlShape):
def __init__(self, *args, **kwargs):
print 'Entering Cross...'
super(Cross, self).__init__(*args, **kwargs)
print 'Leaving Cross...'
x = Cross()
这给了我一个 TypeError: super(type, obj): obj must be an instance or subtype of type。