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

GH-100479: Addpathlib.PurePath.with_segments()#103975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@barneygale
Copy link
Contributor

@barneygalebarneygale commentedApr 28, 2023
edited
Loading

Addpathlib.PurePath.with_segments(), which creates a path object from arguments. This method is called whenever a derivative path is created, such as frompathlib.PurePath.parent. Subclasses may override this method to share information between path objects.

Alternative to#100481.

barneygaleand others added16 commitsDecember 23, 2022 23:18
@barneygalebarneygale changed the titleGH-100479: Addpathlib.PurePath.__newpath__()GH-100479: Addpathlib.PurePath._newpath_()Apr 29, 2023
Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

My personal preference is still for the version with the initializer argument, but it's a weakly held preference, and I think I'm in the minority. This looks good, and you have my approval whichever way you decide to go :)

@merwok
Copy link
Member

I also find the initializer argument nicer than a method.

(But I may be in the minority for style, I have no trouble doingfrom datetime import datetime, timezone for example…)

barneygale reacted with thumbs up emoji

@barneygalebarneygale changed the titleGH-100479: Addpathlib.PurePath._newpath_()GH-100479: Addpathlib.PurePath.with_segments()May 1, 2023
@barneygalebarneygale changed the titleGH-100479: Addpathlib.PurePath.with_segments()GH-100479: Addpathlib.PurePath.with_path()May 2, 2023
@barneygalebarneygale changed the titleGH-100479: Addpathlib.PurePath.with_path()GH-100479: Addpathlib.PurePath.with_segments()May 4, 2023
@barneygalebarneygale marked this pull request as ready for reviewMay 4, 2023 18:09
@barneygalebarneygaleenabled auto-merge (squash)May 5, 2023 18:26
@barneygalebarneygaledisabled auto-mergeMay 5, 2023 18:37
Gobot1234 added a commit to Gobot1234/steam.py that referenced this pull requestMay 5, 2023
@barneygalebarneygaleenabled auto-merge (squash)May 5, 2023 18:42
@barneygalebarneygale merged commitd00d942 intopython:mainMay 5, 2023
@ericsnowcurrently
Copy link
Member

FYI, it looks like the wasm32-wasi buildbot doesn't like this change:https://buildbot.python.org/all/#/builders/1046/builds/1922.

barneygale reacted with eyes emoji

carljm added a commit to carljm/cpython that referenced this pull requestMay 5, 2023
* main:pythongh-99113: Add PyInterpreterConfig.own_gil (pythongh-104204)pythongh-104146: Remove unused var 'parser_body_declarations' from clinic.py (python#104214)pythongh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (pythongh-104205)pythongh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (pythongh-104148)pythongh-99113: Share the GIL via PyInterpreterState.ceval.gil (pythongh-104203)pythonGH-100479: Add `pathlib.PurePath.with_segments()` (pythonGH-103975)pythongh-69152: Add _proxy_response_headers attribute to HTTPConnection (python#26152)pythongh-103533: Use PEP 669 APIs for cprofile (pythonGH-103534)pythonGH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque for users of PEP 523. (pythonGH-96849)
jbower-fb pushed a commit to jbower-fb/cpython that referenced this pull requestMay 8, 2023
)Add `pathlib.PurePath.with_segments()`, which creates a path object from arguments. This method is called whenever a derivative path is created, such as from `pathlib.PurePath.parent`. Subclasses may override this method to share information between path objects.Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@merwokmerwokmerwok left review comments

@eryksuneryksuneryksun left review comments

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@barneygale@merwok@ericsnowcurrently@eryksun@AlexWaygood@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp