[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

Nick Coghlan report at bugs.python.org
Mon Jan 28 12:30:01 CET 2013


Nick Coghlan added the comment:

Oops, forgot the proposed call signature:

    def walk_path(path=None, *, pkg=None):
        """Walk a package hierarchy, starting with the given path

        Iterator producing (package, subpackages, submodules) triples.
        The first entry is the package currently being walked, or None
        for the top level path. The subpackages and submodules entries
        are dictionaries mapping from fully qualified module names to
        the appropriate module loaders.

        Entries may be removed from the subpackages dictionary to avoid
        loading those packages and recursing into them.
        
        If both pkg and path are None, walks sys.path

        If path is not None, walks the specified path.

        If pkg is not None, walks pkg.__path__

        Providing both path and pkg results in ValueError
        """

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17062>
_______________________________________


More information about the Python-bugs-list mailing list