TypeError: __init__() got multiple values for argument 'filters'
时间: 2023-12-06 16:05:02 浏览: 215
This error occurs when the `__init__()` method of a class is called with multiple values for the same argument.
For example, if you have a class `MyClass` with an `__init__()` method that takes a `filters` argument:
```
class MyClass:
def __init__(self, filters):
self.filters = filters
```
And you create an instance of this class and pass multiple values for `filters`:
```
my_instance = MyClass(filters='value1', filters='value2')
```
You will get the `TypeError: __init__() got multiple values for argument 'filters'` error.
To fix this error, make sure that you are only passing one value for each argument in the `__init__()` method. In the above example, you could pass a list of values for `filters` instead:
```
my_instance = MyClass(filters=['value1', 'value2'])
```
阅读全文