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

Method samefile

Lib/pathlib/__init__.py:949–959  ·  view source on GitHub ↗

Return whether other_path is the same or not as this file (as returned by os.path.samefile()).

(self, other_path)

Source from the content-addressed store, hash-verified

947 return False
948
949 def samefile(self, other_path):
950 """Return whether other_path is the same or not as this file
951 (as returned by os.path.samefile()).
952 """
953 st = self.stat()
954 try:
955 other_st = other_path.stat()
956 except AttributeError:
957 other_st = self.with_segments(other_path).stat()
958 return (st.st_ino == other_st.st_ino and
959 st.st_dev == other_st.st_dev)
960
961 def open(self, mode='r', buffering=-1, encoding=None,
962 errors=None, newline=None):

Callers 15

mainFunction · 0.80
_get_revised_pathFunction · 0.80
_samefileFunction · 0.80
test_samefileMethod · 0.80
test_path_samefileMethod · 0.80
test_move_dir_symlinkMethod · 0.80
expect_fileMethod · 0.80
test_hardlink_toMethod · 0.80

Calls 2

statMethod · 0.95
with_segmentsMethod · 0.45

Tested by 14

test_samefileMethod · 0.64
test_path_samefileMethod · 0.64
test_move_dir_symlinkMethod · 0.64
expect_fileMethod · 0.64
test_hardlink_toMethod · 0.64
test_samefileMethod · 0.64
setUpClassMethod · 0.64