Pylint W0232 error: class does not have __init__ method

I have the following error with pylint:

Pylint error W0232: class has no __init__ method 

I understand what that means. I need to create a __init__ method. The problem is that this class inherits from the parent class. I know that I can create the __init__ method and just use super(myclass, self).__init__() , but is it really necessary? I have nothing to add to __init__ . I want to know if it is better to create the __init__ method in any class.

+8
python class pylint
source share
1 answer

As @Sean pointed out, pylint should not complain if __init__() defined in the parent class. pylint odds cannot find this class. Make sure that the module defining it is actually loaded when you call pylint (for example, run it in the containing package).

+2
source share

All Articles