BJörn Lindqvist wrote: > * match() and matchcase() wraps the fnmatch.fnmatch() and > fnmatch.fnmatchcase() functions. I believe that the renaming is > uncontroversial and that the introduction of matchcase() makes it so > the whole fnmatch module can be deprecated. The renaming is fine with me. I generally use the fnmatch module for wildcard matching, not necessarily against path names. Path.match doesn't replace that functionality. Though fnmatch.translate isn't even publically documented, which is the function I actually tend to use. Though it seems a little confusing to me that glob treats separators specially, and that's not implemented at the fnmatch level. So Path('/a/b/d/c').match('a/*/d') is true, but Path('/').walk('a/*/d') won't return Path('/a/b/c/d'). I think .match() should be fixed. But I don't think fnmatch should be changed. I'm actually finding myself a little confused by the glob arguments (if the glob contains '/'), now that I really think about them. -- Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4