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

Method is_relative_to

Lib/pathlib/__init__.py:503–508  ·  view source on GitHub ↗

Return True if the path is relative to another path or False.

(self, other)

Source from the content-addressed store, hash-verified

501 return self._from_parsed_parts('', '', parts)
502
503 def is_relative_to(self, other):
504 """Return True if the path is relative to another path or False.
505 """
506 if not hasattr(other, 'with_segments'):
507 other = self.with_segments(other)
508 return other == self or other in self.parents
509
510 def is_absolute(self):
511 """True if the path is absolute (has both a root and, if applicable,

Callers 3

test_is_relative_toMethod · 0.45

Calls 1

with_segmentsMethod · 0.95

Tested by 3

test_is_relative_toMethod · 0.36