Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
pathlib.Path.glob() callsos.scandir() under the hood, convertingos.DirEntry objects to path objects using a private_make_child_relpath() method. This builds a child path from a given basename. The basename is obtained from the dir entry'sname attribute.
I've just spotted (or realised) that dir entries have apath attribute that we could use, rather than constructing our own string path from the basename. This seems to be a fair bit faster in my testing.