TypeError: RectChart.__init__() takes from 1 to 2 positional arguments but 3 were given
时间: 2023-10-31 12:38:34 浏览: 177
第十一天 04魔法方法【千锋Python人工智能学院】1
This error message indicates that there is a mismatch between the number of arguments passed to the constructor of a class and the number of arguments that the constructor expects.
In this case, the class `RectChart` expects 1 or 2 positional arguments in its constructor, but 3 were given when the constructor was called. This means that there is an extra argument being passed that the class does not expect.
To fix this error, you need to check the code where the constructor is called and make sure that you are passing the correct number of arguments. Alternatively, you may need to update the constructor of the `RectChart` class to accept the additional argument.
阅读全文