-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-24899: Add docs for pathlib.Path.absolute and pathlib to os.path correspondence #1753
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
Changes from 1 commit
8102d8e
c1475df
3ee0c83
6f5b942
955846e
07596a7
6f24cbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…path
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1078,6 +1078,16 @@ Correspondence to tools in the os package | |
| If you're more familiar with :mod:`os.path` module, here's a correspondence | ||
| table on how the same things may be accomplished with pathlib. | ||
|
||
|
|
||
| .. note:: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see in this file there is no blank line after
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the blank line, to adhere to general policy, at least with this change. |
||
| Although :func:`os.path.relpath` and :meth:`PurePath.relative_to` have some | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would simplify this note to: If people want to dive deeper they can then read the docs for the two functions.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adopted the suggested line in next commit. |
||
| overlapping use cases, :meth:`PurePath.relative_to` is more oriented towards | ||
| answering the question "Relative to a given parent directory, how do I reach | ||
| this descendant path?" whereas :func:`os.path.relpath` is implemented to | ||
| answer the "How do I get to path A from path B?". | ||
|
|
||
| If the parameter passed to :meth:`PurePath.relative_to` is not a parent | ||
| node of the object, :exc:`ValueError` exception is raised. | ||
|
|
||
| ============================ ============================== | ||
| os and os.path pathlib | ||
| ============================ ============================== | ||
|
|
||
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.
Basically the documentation doesn't take quite such a casual, conversational tone.
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 correction, changing that line to the suggested one.