MCPcopy Index your code
hub / github.com/python/cpython / filterfalse

Function filterfalse

Lib/fnmatch.py:70–82  ·  view source on GitHub ↗

Construct a list from those elements of the iterable NAMES that do not match PAT.

(names, pat)

Source from the content-addressed store, hash-verified

68
69
70def 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
85def fnmatchcase(name, pat):

Callers 10

test_filterfalseMethod · 0.90
test_caseMethod · 0.90
test_sepMethod · 0.90
phase1Method · 0.85
_filterFunction · 0.85
test_filterfalseMethod · 0.85
test_filterfalseMethod · 0.85
test_filterfalseMethod · 0.85
test_filterfalseMethod · 0.85
unique_everseenFunction · 0.85

Calls 5

listClass · 0.85
matchFunction · 0.85
normcaseMethod · 0.80
_compile_patternFunction · 0.70
appendMethod · 0.45

Tested by 7

test_filterfalseMethod · 0.72
test_caseMethod · 0.72
test_sepMethod · 0.72
test_filterfalseMethod · 0.68
test_filterfalseMethod · 0.68
test_filterfalseMethod · 0.68
test_filterfalseMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…