Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add C implementation of os.path.splitroot() #102511

Closed
Assignees
zooba
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement
@barneygale

Description

@barneygale

Feature or enhancement

Speed upos.path.splitroot() by implementing it in C.

Pitch

Per@eryksun:

I thinksplitroot() warrants a C implementation since it's a required step in our basic path handling on Windows --join(),split(),relpath(), andcommonpath(). Speeding it up gives a little boost across the board. Also, it would be less confusing ifnt._path_splitroot() actually implementedntpath.splitroot().

If implemented, using_Py_splitroot() in_Py_normpath() would help to ensure consistency. Currently, for example,ntpath.normpath('//?/UNC/server/share/../..') is correct on POSIX but wrong on Windows because_Py_normpath() incorrectly handles "//?/UNC/" as the root instead of "//?/UNC/server/share/".

Previous discussion

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp