MCPcopy Index your code
hub / github.com/RustPython/RustPython / full_match

Method full_match

Lib/pathlib/__init__.py:553–568  ·  view source on GitHub ↗

Return True if this path matches the given glob-style pattern. The pattern is matched against the entire path.

(self, pattern, *, case_sensitive=None)

Source from the content-addressed store, hash-verified

551 return prefix + quote_from_bytes(os.fsencode(path))
552
553 def full_match(self, pattern, *, case_sensitive=None):
554 """
555 Return True if this path matches the given glob-style pattern. The
556 pattern is matched against the entire path.
557 """
558 if not hasattr(pattern, 'with_segments'):
559 pattern = self.with_segments(pattern)
560 if case_sensitive is None:
561 case_sensitive = self.parser is posixpath
562
563 # The string representation of an empty path is a single dot ('.'). Empty
564 # paths shouldn't match wildcards, so we change it to the empty string.
565 path = str(self) if self.parts else ''
566 pattern = str(pattern) if pattern.parts else ''
567 globber = _StringGlobber(self.parser.sep, case_sensitive, recursive=True)
568 return globber.compile(pattern)(path) is not None
569
570 def match(self, path_pattern, *, case_sensitive=None):
571 """

Callers 2

test_full_matchMethod · 0.45

Calls 5

with_segmentsMethod · 0.95
_StringGlobberClass · 0.90
hasattrFunction · 0.85
strFunction · 0.85
compileMethod · 0.45

Tested by 2

test_full_matchMethod · 0.36