Depth-first iterator over sub-extensions on `extension`.

def iter_extensions(extension):
    """ Depth-first iterator over sub-extensions on `extension`.
    """
    for _, ext in inspect.getmembers(extension, is_extension):
        for item in iter_extensions(ext):
            yield item
        yield ext