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)
| 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 | """ |
no test coverage detected