[issue29249] Pathlib glob ** bug

Isaac Muse <faceless.server1@gmail.com> added the comment: I think the idea of adding a globmatch function is a decent idea. That is what I did in a library I wrote to get more out of glob than what Python offered out of the box: https://facelessuser.github.io/wcmatch/pathlib/#purepathglobmatch. Specifically the differences are globmatch is just a pure match of a path, it doesn't do the implied `**` at the beginning of a pattern like match does. While it doesn't enable `**` by default, such features are controlled by flags
pathlib.Path("a/b/c/d/e.txt").match('a/*/**/*', flags=pathlib.GLOBSTAR) True
This isn't to promote my library, but more to say, as a user, I found such functionality worth adding. I think it would be generally nice to have such functionality in some form in Python by default. Maybe something called `globmatch` that offers that could be worthwhile. ---------- nosy: +Isaac Muse _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29249> _______________________________________
participants (1)
-
Isaac Muse