True if the path is absolute (has both a root and, if applicable, a drive).
(self)
| 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.""" |