Construct a list from those elements of the iterable NAMES that do not match PAT.
(names, pat)
| 68 | |
| 69 | |
| 70 | def filterfalse(names, pat): |
| 71 | """Construct a list from those elements of the iterable NAMES that do not match PAT.""" |
| 72 | pat = os.path.normcase(pat) |
| 73 | match = _compile_pattern(pat) |
| 74 | if os.path is posixpath: |
| 75 | # normcase on posix is NOP. Optimize it away from the loop. |
| 76 | return list(itertools.filterfalse(match, names)) |
| 77 | |
| 78 | result = [] |
| 79 | for name in names: |
| 80 | if match(os.path.normcase(name)) is None: |
| 81 | result.append(name) |
| 82 | return result |
| 83 | |
| 84 | |
| 85 | def fnmatchcase(name, pat): |
searching dependent graphs…