Per your PR review feedback  I left a comment on the bug  asking when the link_to() method should be scheduled for removal. It didn't elicit a great deal of feedback, so I'm raising this again here!
The proposed deprecation warning in the docs currently reads:
This method is deprecated in favor of :meth:`Path.hardlink_to`, as its
argument order does not match that of :meth:`Path.symlink_to`.
My view is that the removal does not need to happen soon. Any existing code will be written by people who have already figured out the argument reversal, so the current situation doesn't seem dangerous. That said, a speedy deprecation and replacement will remove a guaranteed headache for people creating hardlinks in pathlib.
Apologies if replying to an old thread is bad form - I'm not well versed in mailing list etiquette.
On Wed, 11 Mar 2020 at 17:31, Brett Cannon email@example.com wrote:
Antoine Pitrou wrote:
On Wed, 11 Mar 2020 11:17:22 +0000 Barney Gale firstname.lastname@example.org wrote:
Hi, Pathlib's symlink_to() and link_to() methods have different argument orders, so: a.symlink_to(b) # Creates a symlink from A to B a.link_to(b) # Creates a hard link from B to A
I don't think link_to() was intended to be implemented this way, as the docs say "Create a hard link pointing to a path named target.". It's
inconsistent with everything else in pathlib, most obviously
Bug report here: https://bugs.python.org/issue39291 This /really/ irks me. Apparently it's too late to fix link_to(), so
like to suggest we add a new hardlink_to() method that matches the symlink_to() argument order. link_to() then becomes
I think that's a good idea.
+1 from me as well; new method and deprecate the old one.
Python-Dev mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://email@example.com/message/EID35RFJ... Code of Conduct: http://python.org/psf/codeofconduct/