Undocumented functions glob0() and glob1() were just helpers for glob.iglob(). They are not underscored because the glob module has __all__. They survived numerous refactorings only because they were used in the msilib module and some MSI related scripts. But the msilib module and these scripts have been removed.
glob1(root_dir, pattern) is equivalent to iglob1(os.path.join(glob.escape(root_dir), pattern)), but more restricted and slightly faster, because it does not need to escape root_dir and process the result.
Other alternative is iglob(pattern, root_dir=root_dir), which can even be faster, but it emits paths relative to root_dir. You can use (os.path.join(root_dir, p) for p in iglob(pattern, root_dir=root_dir)) if you need to append root_dir. Actually, creating an efficient replacement of glob1() was one of purposes of root_dir.
glob0(root_dir, name) just checks that os.path.join(root_dir, name) exists. I did not see its use in third-party code.
Linked PRs
Undocumented functions
glob0()andglob1()were just helpers forglob.iglob(). They are not underscored because theglobmodule has__all__. They survived numerous refactorings only because they were used in themsilibmodule and some MSI related scripts. But themsilibmodule 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_dirand process the result.Other alternative is
iglob(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
glob.glob0()andglob.glob1(). #117371