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

Method is_absolute

Lib/pathlib/__init__.py:510–519  ·  view source on GitHub ↗

True if the path is absolute (has both a root and, if applicable, a drive).

(self)

Source from the content-addressed store, hash-verified

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,
512 a drive)."""
513 if self.parser is posixpath:
514 # Optimization: work with raw paths on POSIX.
515 for path in self._raw_paths:
516 if path.startswith('/'):
517 return True
518 return False
519 return self.parser.isabs(self)
520
521 def as_uri(self):
522 """Return the path as a URI."""

Callers 11

as_uriMethod · 0.95
clone_testbedFunction · 0.80
absoluteMethod · 0.80
as_uriMethod · 0.80
from_uriMethod · 0.80
test_uri_windowsMethod · 0.80
_test_cwdMethod · 0.80
_test_homeMethod · 0.80
mainFunction · 0.80

Calls 2

startswithMethod · 0.45
isabsMethod · 0.45

Tested by 5

test_uri_windowsMethod · 0.64
_test_cwdMethod · 0.64
_test_homeMethod · 0.64