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

Method exists

Lib/pathlib/_os.py:399–411  ·  view source on GitHub ↗

Whether this path exists.

(self, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

is_symlinkMethod · 0.95
existsMethod · 0.45

Tested by

no test coverage detected