'Generate the inherited packages of the given package.
Yields (mod, pkg) 2-tuples. The "Exporter" package is skipped.'

def _inherited_mods_and_pkgs_from_pkg(self, pkg, _handled_pkg_names=None):

    pkg_name = pkg.get('name')
    if (_handled_pkg_names is None):
        _handled_pkg_names = set()
    if (pkg_name not in _handled_pkg_names):
        _handled_pkg_names.add(pkg_name)
        for classref in pkg.get('classrefs', '').split():
            if (classref == 'Exporter'):
                continue
            (classref_mod, classref_pkg) = self.pkg_tbl.mod_and_pkg_from_pkg_name(classref)
            if (classref_pkg is None):
                continue
            (yield (classref_mod, classref_pkg))
            for item in self._inherited_mods_and_pkgs_from_pkg(classref_pkg, _handled_pkg_names):
                (yield item)
