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

Method move_into

Lib/pathlib/__init__.py:1392–1403  ·  view source on GitHub ↗

Move this file or directory tree into the given existing directory.

(self, target_dir)

Source from the content-addressed store, hash-verified

1390 return target
1391
1392 def move_into(self, target_dir):
1393 """
1394 Move this file or directory tree into the given existing directory.
1395 """
1396 name = self.name
1397 if not name:
1398 raise ValueError(f"{self!r} has an empty name")
1399 elif hasattr(target_dir, 'with_segments'):
1400 target = target_dir / name
1401 else:
1402 target = self.with_segments(target_dir, name)
1403 return self.move(target)
1404
1405 if hasattr(os, "symlink"):
1406 def symlink_to(self, target, target_is_directory=False):

Callers 1

test_move_intoMethod · 0.80

Calls 2

moveMethod · 0.95
with_segmentsMethod · 0.45

Tested by 1

test_move_intoMethod · 0.64