今天写python的构造函数
遇到了第一个问题
——————TypeError: this constructor takes no arguments
百度之后,原来是因为_init_
正确的做法是前后都是双下划线__init__
本文针对Python编程中构造函数的使用进行了详细的介绍,并针对常见的TypeError: this constructor takes no arguments错误进行了说明,指出了_init_方法的正确书写方式为__init__。
今天写python的构造函数
遇到了第一个问题
——————TypeError: this constructor takes no arguments
百度之后,原来是因为_init_
正确的做法是前后都是双下划线__init__

被折叠的 条评论
为什么被折叠?