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

Method replace

Lib/pathlib/__init__.py:1279–1292  ·  view source on GitHub ↗

Rename this path to the target path, overwriting if that path exists. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instanc

(self, target)

Source from the content-addressed store, hash-verified

1277 return target
1278
1279 def replace(self, target):
1280 """
1281 Rename this path to the target path, overwriting if that path exists.
1282
1283 The target path may be absolute or relative. Relative paths are
1284 interpreted relative to the current working directory, *not* the
1285 directory of the Path object.
1286
1287 Returns the new Path instance pointing to the target path.
1288 """
1289 os.replace(self, target)
1290 if not hasattr(target, 'with_segments'):
1291 target = self.with_segments(target)
1292 return target
1293
1294 def copy(self, target, **kwargs):
1295 """

Callers 15

_parse_pathMethod · 0.45
_parse_patternMethod · 0.45
as_posixMethod · 0.45
moveMethod · 0.45
_generate_index_htmlMethod · 0.45
_generate_file_htmlMethod · 0.45
_build_child_cli_argsMethod · 0.45
_add_markerMethod · 0.45
getSampleCountFunction · 0.45
toggleBytecodeFunction · 0.45
populateBytecodePanelFunction · 0.45

Calls 1

with_segmentsMethod · 0.45

Tested by

no test coverage detected