"glob.glob('weirdness')" Any thoughts?

Dan Sommers 2QdxY4RzWzUUiLuE at potatochowder.com
Tue Sep 11 18:45:27 EDT 2018


On 9/11/18 6:24 PM, Gilmeh Serda wrote:

> I think this is no different than RegEx matching, so the routine really
> shouldn't be called glob() but the_regex_variations_opus_five().

Maybe your version should be called crippled_glob.

Globbing has a long history, longer than many of the people who use it.

See <http://man7.org/linux/man-pages/man7/glob.7.html>.

> If there really is a need for other stuff with brackets and what not,
> this could go into a subclass of glob, say glob.brain_hemorrhage() or
> something, for those so inclined to use it. Or maybe a keyword
> parameter finicky=True/False.

In their simplest form, the brackets match alternatives.  For example,
file[1234].text matches file1.text, file2.text, file3.text, and
file4.text, but not file_something_else.text.

Dan



More information about the Python-list mailing list