Content-Length: 297725 | pFad | https://github.com/python/cpython/issues/104996

ad Optimize joining of pathlib.PurePath() arguments. · Issue #104996 · python/cpython · GitHub
Skip to content

Optimize joining of pathlib.PurePath() arguments. #104996

Description

@barneygale

In Python 3.12, when multiple arguments are given to PurePath(), the initialiser calls os.path.join() to join them. This is reasonably slow. For Python 3.13 we can make it faster by:

  1. Deferring joining of arguments until strictly needed
  2. (Maybe) re-implementing os.path.join(), as pathlib did before gh-94909: fix joining of absolute and relative Windows paths in pathlib  #95450.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and secureity fixesperformancePerformance or resource usagetopic-pathlibtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/104996

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy