-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Match docstring and args for posixpath.join
and ntpath.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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Lib/ntpath.py
Outdated
If any component is an absolute path, all previous path components | ||
will be discarded. An empty last part will result in a path that |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
Adding a docstring for |
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 on |
Do we need a news entry for documentation? |
Adpated docstring from
posixpath.join
tontpath.join
, which was previously blank.Also renamed arguments to
posixpath.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:
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.