cpython
cpython copied to clipboard
Microoptimize glob() for include_hidden=True
If include_hidden is false (by default), the dot-starting names are filtered out if the pattern does not start with a dot. If include_hidden is true, no filtering is needed, but the current code still creates a generator expression to filter names with condition which is always true.
It unlikely has measurable effect in most cases, taking into account the time of the IO operations, os.path.join(), etc.
Linked PRs
- gh-117135