__init__() got an unexpected keyword argument 'strict
时间: 2023-10-04 19:08:01 浏览: 65
This error usually occurs when you are passing an argument to a function that it doesn't recognize. The function you are calling may not have the argument you are trying to pass, or you may have misspelled the argument name.
To fix this error, check the documentation of the function and make sure you are passing the correct arguments. If you are using a third-party library, make sure you are using the correct version of the library and check the documentation for any changes in the function signature.
If you are still having trouble, please provide more information about the code and the specific function that is causing the error.
相关问题
__init__() got an unexpected keyword argument
__init__()方法是Python中的一个特殊方法,用于初始化对象的属性。当在创建对象时,传递给__init__()方法的参数与定义的参数不匹配时,就会出现"__init__() got an unexpected keyword argument"的错误。
这个错误通常发生在以下情况下:
1. 定义了一个类,并在__init__()方法中定义了一些参数,但在创建对象时传递了不匹配的参数。
2. 在子类中重写了父类的__init__()方法,并且子类的参数与父类的参数不匹配。
解决这个问题的方法是检查传递给__init__()方法的参数是否与定义的参数一致。确保参数名称和数量都正确,并且没有多余的参数。
TypeError:init_()got an unexpected keyword argument
TypeError:init_()got an unexpected keyword argument是一个类型错误,它表示在调用init_()函数时传入了一个未预期的关键字参数。通常情况下,这种错误是由于函数的定义与调用之间的参数不匹配导致的。
可能的原因有:
1. 函数定义中没有定义该关键字参数。
2. 函数定义中的参数名拼写错误。
3. 函数调用时传入了多余的关键字参数。
要解决这个错误,你可以检查函数的定义和调用,确保参数的名称和数量匹配。如果函数定义中确实没有该参数,你可以考虑修改函数定义或者检查是否传入了正确的参数。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)