[Python-Dev] Re: pathlib.Path: inconsistent symlink_to() and link_to()

2020年3月11日 08:58:10 -0700

On 2020年3月11日 11:17:22 +0000
Barney Gale <[email protected]> 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 also
> inconsistent with everything else in pathlib, most obviously symlink_to().
> 
> Bug report here: https://bugs.python.org/issue39291
> 
> This /really/ irks me. Apparently it's too late to fix link_to(), so I'd
> like to suggest we add a new hardlink_to() method that matches the
> symlink_to() argument order. link_to() then becomes deprecated/undocumented.
I think that's a good idea.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/7BL6FK4ZFVBMGKIMZA53ODDO3H5CN5HJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to