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

Function _make_selector

tools/python-3.11.9-amd64/Lib/pathlib.py:281–294  ·  view source on GitHub ↗
(pattern_parts, flavour)

Source from the content-addressed store, hash-verified

279#
280
281def _make_selector(pattern_parts, flavour):
282 pat = pattern_parts[0]
283 child_parts = pattern_parts[1:]
284 if not pat:
285 return _TerminatingSelector()
286 if pat == '**':
287 cls = _RecursiveWildcardSelector
288 elif '**' in pat:
289 raise ValueError("Invalid pattern: '**' can only be an entire path component")
290 elif _is_wildcard_pattern(pat):
291 cls = _WildcardSelector
292 else:
293 cls = _PreciseSelector
294 return cls(pat, child_parts, flavour)
295
296if hasattr(functools, "lru_cache"):
297 _make_selector = functools.lru_cache()(_make_selector)

Callers 3

__init__Method · 0.85
globMethod · 0.85
rglobMethod · 0.85

Calls 2

_is_wildcard_patternFunction · 0.85

Tested by

no test coverage detected