MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _compile_pattern

Function _compile_pattern

tools/python-3.11.9-amd64/Lib/fnmatch.py:39–46  ·  view source on GitHub ↗
(pat)

Source from the content-addressed store, hash-verified

37
38@functools.lru_cache(maxsize=32768, typed=True)
39def _compile_pattern(pat):
40 if isinstance(pat, bytes):
41 pat_str = str(pat, 'ISO-8859-1')
42 res_str = translate(pat_str)
43 res = bytes(res_str, 'ISO-8859-1')
44 else:
45 res = translate(pat)
46 return re.compile(res).match
47
48def filter(names, pat):
49 """Construct a list from those elements of the iterable NAMES that match PAT."""

Callers 2

filterFunction · 0.85
fnmatchcaseFunction · 0.85

Calls 3

strFunction · 0.85
translateFunction · 0.70
compileMethod · 0.45

Tested by

no test coverage detected