Coder Social home page Coder Social logo

Maximize compatibility with `pathlib.Path` about path HOT 6 OPEN

5j9 avatar 5j9 commented on September 6, 2024
Maximize compatibility with `pathlib.Path`

from path.

Comments (6)

jaraco avatar jaraco commented on September 6, 2024 1

Nice. Sounds good. I welcome the contributions. In cases where the functionality is duplicative and the pathlib syntax is inarguably as good, let's also deprecate any local pecularities.

from path.

jaraco avatar jaraco commented on September 6, 2024

In #218, I'm working on adding support for .suffix, .with_stem, and .with_name.

from path.

jaraco avatar jaraco commented on September 6, 2024

Looks like link_to was replaced by hardlink_to and removed.

from path.

jaraco avatar jaraco commented on September 6, 2024

I'm looking at symlink_to and hardlink_to, and it's interesting. pathlib's implementation is very different, switching the order of arguments. It's not obvious why the order of arguments was switched (from os.path equivalents) and in fact, the order was only switched in symlink_to originally and later in hardlink_to. I'm not sure yet if the other ones should be deprecated. I'm leaning toward keeping them for now.
Another difference is that pathlib doesn't return anything for symlink_to or hardlink_to, but the path implementation does. It seems to me that returning something would be useful, but I'm yet unsure what is best to return. I'll probably start with not returning anything at all (matching the pathlib behavior) unless there's a case to be made for a returned value.

from path.

jaraco avatar jaraco commented on September 6, 2024

I observe that Path.owner and pathlib.Path.owner() are incompatible. It won't be possible to align those without first deprecating .owner.

from path.

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.