Hi,

I have written some code to fix bug #5975. The idea is that abstract classes
should not have to implement methods of parent classes. I added a check in
the _check_bases_classes(self, node) function in the classes.py module to
test if the provided class is abstract, if so, do not check that it
implements functions from a parent class.

     # check if this class abstract
        if class_is_abstract(node):
            return

and a function class_is_abstract:

def class_is_abstract(node):
    """return true if the given class node should be considered as an
abstract
    class
    """
    for method in node.methods():
        owner = method.parent.frame()
        if owner is node:
            if method.is_abstract(pass_is_abstract=False):
                return True

    return False

Does this seem like a reasonable fix?
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to