Skip to content

Microoptimize glob() for include_hidden=True #117134

@serhiy-storchaka

Description

@serhiy-storchaka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions