[code-quality] Pylint: super-init-not-called when ancestor class is abstract

Dunatotatos contact at dunatotatos.com
Fri May 11 11:53:22 EDT 2018


Hi all,

Please CC-me in all answers to this message, I am not subscribed to the 
mailing list.

If I implement an abstract class in Python:

>>> class Ancestor(object):
>>>     def __init__(self):
>>>         raise NotImplementedError

Then write a child class:

>>> class Child(Ancestor):
>>>     def __init__(self):
>>>         return self

Pylint finds a warning W0231 super-init-not-called on the definition of 
Child.__init__.
IMHO, it should not be the case, as a Child class will never call the 
constructor of the ancestor.

Am I missing something?

Best,
Duna
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/code-quality/attachments/20180511/04707afa/attachment.sig>


More information about the code-quality mailing list