TypeError: __init__() missing 1 required positional argument: 'WSI_object'
时间: 2023-08-18 20:12:00 浏览: 111
TypeError: _queue_reduction(): incompatible function arguments.
这个错误是因为在代码中调用了一个缺少必需参数的初始化方法。具体来说,在引用\[2\]的代码中,创建FictionBook类的实例时,调用了父类Book的初始化方法,但是缺少了一个必需的参数comment,导致报错。解决这个问题的方法是在调用父类初始化方法时,传入正确的参数。具体来说,在FictionBook类的初始化方法中,应该将Book.__init__方法的参数改为(name, author, comment, state=0)。这样就能够正确执行程序了。\[2\]
#### 引用[.reference_title]
- *1* [python错误:TypeError: __init__() missing 1 required positional argument: ‘n](https://blog.csdn.net/m0_51788349/article/details/118655043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Python成功解决TypeError: __init__() missing 1 required positional argument: ‘comment](https://blog.csdn.net/weixin_44991673/article/details/110099428)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [运行报错provider = models.ForeignKey(Provider, on_delete=True) TypeError(‘on_delete must be ...](https://blog.csdn.net/qq_32057095/article/details/108845704)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文