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

Match docstring and args forposixpath.join andntpath.join#104478

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

Open
brl0 wants to merge9 commits intopython:main
base:main
Choose a base branch
Loading
frombrl0:sync_join_funcs

Conversation

brl0
Copy link

@brl0brl0 commentedMay 14, 2023
edited
Loading

Adpated docstring fromposixpath.join tontpath.join, which was previously blank.

Also renamed arguments toposixpath.join to matchntpath.join. This is a cosmetic change, but I think they should have matching signatures since they are used interchangeably byos.path andpathlib.

Here are the current signatures:

functionsignature
posixpath.joindef join(a, *p)
ntpath.joindef join(path, *paths)

This change is not much more than fixing a typo, so I didn't open an issue for this, but would be willing to do so if that is preferred.
Also, this change is probably not news-worthy, but I can add an entry if needed.

@bedevere-bot

This comment was marked as outdated.

@ghost
Copy link

ghost commentedMay 14, 2023
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot

This comment was marked as duplicate.

Lib/ntpath.py Outdated
Comment on lines 109 to 110
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
Copy link
Contributor

Choose a reason for hiding this comment

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

In ntpath, "absolute path" means a path with a root, such as "\bar". If this path does not have a drive letter, then the previous drive letter (if any) is retained. So it's not right to say that all previous components will be discarded -- it's a little more subtle than that!

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the clarification! I made a change to be more descriptive, let me know if it still needs work.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@barneygale
Copy link
Contributor

Adding a docstring foros.path.join() on Windows is worthy of an issue and a news entry, IMO.

@bedevere-bot

This comment was marked as duplicate.

@bedevere-bot

This comment was marked as duplicate.

@bedevere-bot

This comment was marked as duplicate.

@bedevere-bot

This comment was marked as duplicate.

@bedevere-bot

This comment was marked as duplicate.

@brl0
Copy link
Author

@barneygale,

Thanks for your quick review and feedback, it is much appreciated. I have made the requested changes; please review again.

Also, thanks for your great work onpathlib. I have been contributing to a projectuniversal_pathlib, based onfsspec, and it was in that context I was digging around some of your changes incpython to begin with. I was trying to figure out what would need to be adapted to properly implement a new path flavour module for classes inheriting frompathlib, which is why I was looking closely at docstrings and function args.

@bedevere-bot

This comment was marked as duplicate.

@arhadthedev
Copy link
Member

Do we need a news entry for documentation?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@barneygalebarneygaleAwaiting requested review from barneygale

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@brl0@bedevere-bot@barneygale@arhadthedev

[8]ページ先頭

©2009-2025 Movatter.jp