Python's glob() (fnmatch really) translates the glob to a regular expression then uses its re library:
https://github.com/python-git/python/blob/715a6e5035bb21ac49...
Python's glob() (fnmatch really) translates the glob to a regular expression then uses its re library:
https://github.com/python-git/python/blob/715a6e5035bb21ac49...
Seriously, though, it was a bit of an afterthought. A team at Google was |ing together a ton of regexps and came to me for something better, so I wrote RE2::Set. I'm glad it helps others too.
https://github.com/python-git/python/blob/715a6e5035bb21ac49...
https://github.com/borgbackup/borg/blob/master/src/borg/shel... http://borgbackup.readthedocs.io/en/stable/usage.html#borg-h... ("Shell-style patterns, selector sh:")
It's specifically a CPython optimisation, it may (and usually will) not hold up on alternate implementations like pypy or jyton.
If PyPy or Jython want to reuse that core library code, it's on them to make whatever changes are needed to make it fast on those implementations.