Coder Social home page Coder Social logo

Comments (4)

eryksun avatar eryksun commented on June 24, 2024

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.

from cpython.

barneygale avatar barneygale commented on June 24, 2024

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!

from cpython.

eryksun avatar eryksun commented on June 24, 2024

pathlib doesn't return self

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.

from cpython.

adventurecomputer avatar adventurecomputer commented on June 24, 2024

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.

from cpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.