TypeError: object() takes no parameters

 TypeError: this constructor takes no arguments

如下是学习python类时遇到的一个小例子。经过查阅资料才知道,是构造函数写错的问题,

__init__(self,name)这个构造函数的左右下划线都是两个,我只用了一个,导致错误。

 

Python中错误之 TypeError: object() takes no parameters、TypeError: this constructor takes no arguments

 

相关文章:

  • 2022-01-22
  • 2021-12-27
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-07-14
  • 2022-12-23
  • 2021-07-28
相关资源
相似解决方案