Whether this path exists.
(self, *, follow_symlinks=True)
| 397 | __slots__ = ('_exists', '_is_dir', '_is_file', '_is_symlink') |
| 398 | |
| 399 | def exists(self, *, follow_symlinks=True): |
| 400 | """Whether this path exists.""" |
| 401 | if not follow_symlinks and self.is_symlink(): |
| 402 | return True |
| 403 | try: |
| 404 | return self._exists |
| 405 | except AttributeError: |
| 406 | if os.path.exists(self._path): |
| 407 | self._exists = True |
| 408 | return True |
| 409 | else: |
| 410 | self._exists = self._is_dir = self._is_file = False |
| 411 | return False |
| 412 | |
| 413 | def is_dir(self, *, follow_symlinks=True): |
| 414 | """Whether this path is a directory.""" |
nothing calls this directly
no test coverage detected