Answer by Reinderien for Matcher/Searcher with Glob support
I think it may be a good idea to leverage fnmatch.filter() instead of writing an inner loop on a bare fnmatch.Add type hints, including - potentially - a generic type hint for your data. Since you...
View ArticleAnswer by J_H for Matcher/Searcher with Glob support
Is this efficient?No.Let's say I have data like this ...You introduce a size N python dict, similar to a java HashMap.For "generic" globbing, against arbitrary "*-foo-*" patterns, this may suffice.For...
View ArticleMatcher/Searcher with Glob support
Let's say I have data like this:DATA = {"Alfa-1": {...},"Beta-1": {...},"Beta-2": {...},"Delta-1": {...},"Delta-2": {...}, # and so on}I want to perform extraction, but I want the key to also support...
View ArticleAnswer by leaf_yakitori for Matcher/Searcher with Glob support
unnecessary syntax sugar:casefold(): Although I highly doubt lower() is enough, I assume you really need it and keep it.map:= operatorsunnecessary if-else:fnmatch can handle equal situationunnecessary...
View Article