Open mwichmann opened 3 years ago
I think this would be great and very useful enhancement!
So while we're at it, Python's glob
module has a companion iglob
method, which returns an iterator, and the implementation of glob
itself is now this simple:
return list(iglob(pathname, root_dir=root_dir, dir_fd=dir_fd, recursive=recursive))
Is it worth doing similar for SCons? If so - iGlob
? Globi
? other name?
Meanwhile, the pathlib
glob support took a slightly different design choice. Path.glob()
automatically selects recursive mode if the pattern starts with **/
, a kwarg to enable recursive is not needed; it also has a Path.rglob()
which does the recursive globbing without needing the **/
in the pattern. Just some things to think about.
This has been discussed in Discord, wanted to record it.
Python's
glob.glob
now has a specifier for a recursive glob:and it seems, since the SCons
Glob
rather mirrors the Python module (though it's not the same), that it would be a useful addition there. Other build tools, e.g. Bazel, also support the recursive syntax in their globbing functionality.