]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH...
authorBarney Gale <barney.gale@gmail.com>
Sat, 29 Jun 2024 15:38:39 +0000 (16:38 +0100)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 15:38:39 +0000 (16:38 +0100)
commit22dfecf1f52ab978ce4529d7cd2f5a2f352a2792
treec9cdddd0cb289559edca412691388fe50c0b54d3
parent6a8cb77f49a82f359c5ee5f1f6bab8aba445c562
[3.12] GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970) (#121156)

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)
Doc/library/pathlib.rst