You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The symlink_to() and hardlink_to() methods create a symlink or hardlink in the filesystem, but they do not return a Path object for it. This could be new behavior for a feature enhancement in Python 3.14, but it's not a bug.
pathlib doesn't return self to facilitate method chaining at the moment. I'd rather not add support because it doesn't seem necessary and complicates the API slightly. But I'll keep an open mind if you'd like to put together a rationale @adventurecomputer!
Maybe returning a Path is a good idea here, but I don't think returning self is generally a good idea, unless it's an absolute path. The working directory could change, but for sure the returned Path should always refer to the symlink or hardlink that was created in the filesystem.
I was testing codellama in my workflow, and this snippet came up as one of the suggestions. It seemed reasonable to assume the pattern of <returned object> = <object>.instance_method() was being followed and using pydoc the results don't show types of the return, so I assumed this was the case.
Bug report
Bug description:
link is supposed to be a newly created symlink object.
CPython versions tested on:
3.8
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: