-
-
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
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -641,8 +641,8 @@ call fails (for example because the path doesn't exist): | |
| Return an absolute version of this path. This function works | ||
| even if the path doesn't point to anything. | ||
|
|
||
| No normalization is done, i.e. all '.' and '..' will be kept along. | ||
| Use resolve() to get the canonical path to a file. | ||
| No normalization is done, i.e. all ``.`` and ``..`` will be kept along. | ||
| Use :meth:`Path.resolve` to get the canonical path to a file. | ||
|
|
||
| Usage example:: | ||
|
|
||
|
|
@@ -1072,13 +1072,14 @@ call fails (for example because the path doesn't exist): | |
|
|
||
| .. versionadded:: 3.5 | ||
|
|
||
| Correspondence to tools in the os package | ||
| ----------------------------------------- | ||
| Correspondence to tools in the :mod:`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. | ||
| table on how the same things may be accomplished with :mod:`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 | ||
|
|
||
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.
osis a module. You should write: .... tools in the:mod:`os`moduleThere 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, I missed that correction from last comment, I thought only the link was missing. Fixing in next commit.