Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Undocumented functionsglob0() andglob1() were just helpers forglob.iglob(). They are not underscored because theglob module has__all__. They survived numerous refactorings only because they were used in themsilib module and some MSI related scripts. But themsilib module and these scripts have been removed.
glob1(root_dir, pattern) is equivalent toiglob1(os.path.join(glob.escape(root_dir), pattern)), but more restricted and slightly faster, because it does not need to escaperoot_dir and process the result.
Other alternative isiglob(pattern, root_dir=root_dir), which can even be faster, but it emits paths relative toroot_dir. You can use(os.path.join(root_dir, p) for p in iglob(pattern, root_dir=root_dir)) if you need to appendroot_dir. Actually, creating an efficient replacement ofglob1() was one of purposes ofroot_dir.
glob0(root_dir, name) just checks thatos.path.join(root_dir, name) exists. I did not see its use in third-party code.
Linked PRs
Metadata
Metadata
Assignees
Projects
Status