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

Method replace

Lib/pathlib/__init__.py:1081–1094  ·  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

1079 return target
1080
1081 def replace(self, target):
1082 """
1083 Rename this path to the target path, overwriting if that path exists.
1084
1085 The target path may be absolute or relative. Relative paths are
1086 interpreted relative to the current working directory, *not* the
1087 directory of the Path object.
1088
1089 Returns the new Path instance pointing to the target path.
1090 """
1091 os.replace(self, target)
1092 if not hasattr(target, 'with_segments'):
1093 target = self.with_segments(target)
1094 return target
1095
1096 def copy(self, target, **kwargs):
1097 """

Callers 4

_parse_pathMethod · 0.45
_parse_patternMethod · 0.45
as_posixMethod · 0.45
moveMethod · 0.45

Calls 2

hasattrFunction · 0.85
with_segmentsMethod · 0.45

Tested by

no test coverage detected