相关疑难解决方法(0)

TypeError:module .__ init __()最多需要2个参数(给定3个)

我在一个名为的文件中定义了一个类Object.py.当我尝试从另一个文件中继承此类时,调用构造函数会引发异常:

TypeError: module.__init__() takes at most 2 arguments (3 given)
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

import Object

class Visitor(Object):
    pass

instance = Visitor()  # this line throws the exception
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

python python-3.x

131
推荐指数
3
解决办法
11万
查看次数

标签 统计

python ×1

python-3.x ×1