pylint/pyreverse/inspector.py
def interfaces(node, herited=True, handler_func=_iface_hdlr):
    """Return an iterator on interfaces implemented by the given class node."""
    # FIXME: what if __implements__ = (MyIFace, MyParent.__implements__)...
    try:
        implements = bases.Instance(node).getattr("__implements__")[0]
    except exceptions.NotFoundError:
        return
    if not herited and implements.frame() is not node:
        return
    found = set()
    missing = False
    for iface in node_classes.unpack_infer(implements):
        if iface is astroid.Uninferable:
            missing = True
            continue
        if iface not in found and handler_func(iface):
            found.add(iface)
            yield iface
    if missing:
        raise exceptions.InferenceError()
def interfaces(node, herited=True, handler_func=_iface_hdlr):
    # FIXME: what if __implements__ = (MyIFace, MyParent.__implements__)...
    try:
        implements = bases.Instance(node).getattr("__implements__")[0]
    except exceptions.NotFoundError:
        return
    if not herited and implements.frame() is not node:
        return
    found = set()
    missing = False
    for iface in node_classes.unpack_infer(implements):
        if iface is astroid.Uninferable:
            missing = True
            continue
        if iface not in found and handler_func(iface):
            found.add(iface)
            yield iface
    if missing:
        raise exceptions.InferenceError()
def interfaces ( node , herited = True , handler_func = _iface_hdlr ) : # FIXME: what if __implements__ = (MyIFace, MyParent.__implements__)... try : implements = bases . Instance ( node ) . getattr ( "__implements__" ) [ 0 ] except exceptions . NotFoundError : return if not herited and implements . frame ( ) is not node : return found = set ( ) missing = False for iface in node_classes . unpack_infer ( implements ) : if iface is astroid . Uninferable : missing = True continue if iface not in found and handler_func ( iface ) : found . add ( iface ) yield iface if missing : raise exceptions . InferenceError ( )
Return an iterator on interfaces implemented by the given class node.
Return an iterator on interfaces implemented by the given class node .