def walkFlatten(interface, shouldEnterIntfFn):
    """
    :param shouldEnterIntfFn: function (actual interface)
        returns tuple (shouldEnter, shouldYield)
    """
    _shouldEnter, _shouldYield = shouldEnterIntfFn(interface)
    if _shouldYield:
        yield interface

    if shouldEnterIntfFn:
        for intf in interface._interfaces:
            yield from walkFlatten(intf, shouldEnterIntfFn)
def walkFlatten(interface, shouldEnterIntfFn):
    """
    :param shouldEnterIntfFn: function (actual interface)
        returns tuple (shouldEnter, shouldYield)
    """
    _shouldEnter, _shouldYield = shouldEnterIntfFn(interface)
    if _shouldYield:
        yield interface

    if shouldEnterIntfFn:
        for intf in interface._interfaces:
            yield from walkFlatten(intf, shouldEnterIntfFn)
def walkFlatten ( interface , shouldEnterIntfFn ) : _shouldEnter , _shouldYield = shouldEnterIntfFn ( interface ) if _shouldYield : yield interface if shouldEnterIntfFn : for intf in interface . _interfaces : yield from walkFlatten ( intf , shouldEnterIntfFn )
:param shouldEnterIntfFn: function (actual interface)
        returns tuple (shouldEnter, shouldYield)
: param shouldEnterIntfFn : function ( actual interface ) returns tuple ( shouldEnter shouldYield )