]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 29 Jun 2024 15:37:55 +0000 (17:37 +0200)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 15:37:55 +0000 (16:37 +0100)
commitc70f1122b4d00818c9f197931a0c8ac86505d214
tree904077ca068a958b6a3bcaa784c41dd140833297
parentd96a52e1366ad5e798839a63e68a0a1b9d728f9c
[3.13] GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970) (#121155)

GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970)

Add dedicated subsection for `home()`, `expanduser()`, `cwd()`,
`absolute()`, `resolve()` and `readlink()`. The position of this section
keeps all the `Path` constructors (`Path()`, `Path.from_uri()`,
`Path.home()` and `Path.cwd()`) near the top. Within the section, closely
related methods are kept adjacent. Specifically:

- `home()` and `expanduser()` (the former calls the latter)
- `cwd()` and `absolute()` (the former calls the latter)
- `absolute()` and `resolve()` (both make paths absolute)
- `resolve()` and `readlink()` (both read symlink targets)
- Ditto `cwd()` and `absolute()`
- Ditto `absolute()` and `resolve()`

The "Other methods" section is removed.

(cherry picked from commit d6d8707ff217f211f3a2e48084cc0ddfa41efc4d)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Doc/library/pathlib.rst