Subclasses of abstract class that do not inherit abc.ABC are considered abstract #7950
Labels
False Negative 🦋
No message is emitted but something is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Bug description
Related to #3098. Subclasses of an abstract parent class which do not inherit directly from
abc.ABC
are considered abstract, and only throw an error during run time when trying to instantiate it.For example, take this code below. PyCharm correctly determines through a IDE warning that Sub is not abstract, and says
Class Sub must implement all abstract methods
, but pylint will ignore this class, as its ancestors inherit fromabc.ABC
. Do we not get the best of both worlds (allowing abstract subclasses of abstract parent classes, ie.AbsSub
, while catching non-abstract subclasses of abstract parent classes, ie.Sub
) if we check the bases, instead of the ancestors where that PR to fix the issue above does it?Configuration
No response
Command used
Pylint output
`NOTHING`
Expected behavior
test.py:19:0: W0223: Method 'test_something' is abstract in class 'Abstract' but is not overridden (abstract-method)
(referring toSub
)Pylint version
OS / Environment
Ubuntu 20.04
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: