You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following code, Pylint emits an abstract-method. We could probably use the new .mro method for new style classes while searching for the abstract method (as it is done for abstract-class-instantiated). For old style classes, using the current approach should suffice.
#!python
import abc
class A(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def test(self): pass
class X(A):
pass
class B(X):
def x(self): pass
test = x
B().test()
Use a mro traversal for finding abstract methods. Closes issue #415.
This patch adds a new unimplemented_abstract_methods in pylint.checkers.utils,
which is used to obtain all the abstract methods which weren't implemented
anywhere in the mro of a class. The code works now by traversing the mro, gathering
all abstract methods encountered at each step and resolving the implemented ones
through either definition or assignment. This disables a couple of false
positives on classes with complex hierarchies.
Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore)
Given the following code, Pylint emits an abstract-method. We could probably use the new .mro method for new style classes while searching for the abstract method (as it is done for abstract-class-instantiated). For old style classes, using the current approach should suffice.
The text was updated successfully, but these errors were encountered: