[New-bugs-announce] [issue42999] `pathlib.Path.link_to()` documentation is misleading

Barney Gale report at bugs.python.org
Thu Jan 21 23:24:20 EST 2021

New submission from Barney Gale <barney.gale at gmail.com>:

Compare the documentation of `symlink_to()` and `link_to()`:

.. method:: Path.symlink_to(target, target_is_directory=False)
    Make this path a symbolic link to *target*.

.. method:: Path.link_to(target)
    Create a hard link pointing to a path named *target*.

In fact, `link_to()` does something like:

    Make *target* a hard link to this path.

Which is unexpected given the naming and inconsistency with `symlink_to()`, but it's the way the current implementation works, and so the documentation should reflect that.

Adding a replacement `hardlink_to()` function is covered here in bpo-39950.

assignee: docs at python
components: Documentation
messages: 385474
nosy: barneygale, docs at python
priority: normal
severity: normal
status: open
title: `pathlib.Path.link_to()` documentation is misleading
type: behavior

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list