]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (#120970)
authorBarney Gale <barney.gale@gmail.com>
Sat, 29 Jun 2024 15:09:47 +0000 (16:09 +0100)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 15:09:47 +0000 (16:09 +0100)
commitd6d8707ff217f211f3a2e48084cc0ddfa41efc4d
treebdce518698ca1d58d10e5d5e17001c9f9af25dc7
parent2cb84b107ad136eafb6e3d69145b7bdaefcca879
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (#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.
Doc/library/pathlib.rst