@@ -1366,17 +1366,26 @@ def link_to(self, target):
1366
1366
1367
1367
def rename (self , target ):
1368
1368
"""
1369
- Rename this path to the given path,
1370
- and return a new Path instance pointing to the given path.
1369
+ Rename this path to the target path.
1370
+
1371
+ The target path may be absolute or relative. Relative paths are
1372
+ interpreted relative to the current working directory, *not* the
1373
+ directory of the Path object.
1374
+
1375
+ Returns the new Path instance pointing to the target path.
1371
1376
"""
1372
1377
self ._accessor .rename (self , target )
1373
1378
return self .__class__ (target )
1374
1379
1375
1380
def replace (self , target ):
1376
1381
"""
1377
- Rename this path to the given path, clobbering the existing
1378
- destination if it exists, and return a new Path instance
1379
- pointing to the given path.
1382
+ Rename this path to the target path, overwriting if that path exists.
1383
+
1384
+ The target path may be absolute or relative. Relative paths are
1385
+ interpreted relative to the current working directory, *not* the
1386
+ directory of the Path object.
1387
+
1388
+ Returns the new Path instance pointing to the target path.
1380
1389
"""
1381
1390
self ._accessor .replace (self , target )
1382
1391
return self .__class__ (target )
0 commit comments