Skip to content

Glob(): add an include_hidden flag #4231

Open
@mwichmann

Description

@mwichmann

Glob inherits from Python's glob.glob special handling of directory entries that begin with dot. This rule is, in turn, inherited from POSIX (UNIX) glob, which refers to this piece from section 2.13.3 on filename expansion:

2.If a filename begins with a <period> ('.'), the <period> shall be explicitly matched by using a <period> as the first character of the pattern or immediately following a <slash> character. The leading <period> shall not be matched by the <asterisk> or <question-mark> special characters, a bracket expression containing a non-matching list, such as "[!a]", a range expression, such as "[%−0]", or a character class expression, such as "[[:punct:]]".

In very recent Python (will be in the 3.11 release next month), there is a new flag include_hidden which turns off this special behavior and allows a leading dot to be matched.

Propose that we extend Glob with a keyword argument of the same functionality (could be the same name or different)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions