cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Microoptimize glob() for include_hidden=True

Open serhiy-storchaka opened this issue 1 year ago • 0 comments

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

serhiy-storchaka avatar Mar 21 '24 20:03 serhiy-storchaka