我正在尝试从具有以下结构的子模块初始化父模块:
$ cat caller.py
#!/usr/bin/env
import child
$ cat parent.py
class parent(object):
def __init__(self):
print "initialised parent"
$ cat child.py
import parent
class child(parent):
def __init__(self):
print "initialised child"
但是我收到以下错误:
Traceback (most recent call last):
File "caller.py", line 3, in <module>
import child
File "child.py", line 2, in <module>
class child(parent):
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)
我究竟做错了什么?