[issue13968] Add a recursive function to the glob package

Antoine Pitrou report at bugs.python.org
Wed Feb 8 16:52:06 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> IOW, globbing is usually understood as the act of expanding a pattern
> to the files it matches. Nothing in that implies recursive traversal
> of a directory tree.

Still, that's a common need. "I want all Python files in a subtree".

> On the other hand, os.walk and/or walkdir suggest that in their name.

I don't know why "walk" is supposedly more recursive than "glob".

> Admittedly, we already have more than one, and a high-level tool is
> proposed with Nick's walkdir. Why add *yet another* high-level tool?

Because the walkdir spelling (IIUC) is longish, tedious and awkward.
I could see myself typing "rglob('*.py')" in a short script or an
interpreter session, without having to look up any kind of docs.
Certainly not the walkdir alternative (I've already forgotten what it
is).

----------

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


More information about the Python-bugs-list mailing list