内容简介:正如@Sean指出的那样,如果在父类中定义__init __(),则pylint翻译自:https://stackoverflow.com/questions/19622484/pylint-error-w0232-class-has-no-init-method
Pylint error W0232: class has no __init__ method
我明白这意味着什么.我必须创建__init__方法.
问题是这个类是从父类继承的.我知道我能够创建__init__方法并且只使用super(myclass,self).__ init __()但是它真的有必要吗?我没有任何东西可以添加到__init__.我想知道在任何类中创建__init__方法是否更好.
正如@Sean指出的那样,如果在父类中定义__init __(),则pylint should not 会抱怨. Сhances是pylint找不到那个类.确保在 invoke pylint中实际加载了定义它的模块(例如在包含的包上运行它).
翻译自:https://stackoverflow.com/questions/19622484/pylint-error-w0232-class-has-no-init-method
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Practical Algorithms for Programmers
Andrew Binstock、John Rex / Addison-Wesley Professional / 1995-06-29 / USD 39.99
Most algorithm books today are either academic textbooks or rehashes of the same tired set of algorithms. Practical Algorithms for Programmers is the first book to give complete code implementations o......一起来看看 《Practical Algorithms for Programmers》 这本书的介绍吧!