「引数の定義は4個なのに5個与えられた」というエラーです。
Blockは自作クラスですか?
Blockクラスの__init___
メソッドの最初の引数はself
で、他に4個の引数定義が書いてありますか?
エラーになる定義例
>>> class Block:
... def __init__(a, b, c, d):
... pass
...
>>> Block(1, 2, 3, 4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Block.__init__() takes 4 positional arguments but 5 were given
エラーにならない定義例
>>> class Block:
... def __init__(self, a, b, c, d):
... pass
...
>>> Block(1, 2, 3, 4)
<__main__.Block object at 0x7fd32ab9d590>
1Like