Skip to content
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

Documentation of pathlib.Path methods is disorganised #119054

Closed
barneygale opened this issue May 14, 2024 · 2 comments
Closed

Documentation of pathlib.Path methods is disorganised #119054

barneygale opened this issue May 14, 2024 · 2 comments
Labels
docs Documentation in the Doc dir topic-pathlib

Comments

@barneygale
Copy link
Contributor

barneygale commented May 14, 2024

Documentation

The docs for pathlib.Path methods is disorganised. It was originally alphabetical, but over the last few years we've begun moving similar methods together. We ought to split it up into sections, to make it easier to navigate and absorb, e.g.:

  • Parsing and generating URIs
  • Querying file type and status
  • Reading and writing files
  • Iterating over directories
  • Making paths absolute
  • Expanding home directories
  • Resolving symlinks
  • Permissions
  • Ownership
  • Other methods

If this granularity is too fine, we could stick more stuff in "Other methods".

Linked PRs

@barneygale barneygale added docs Documentation in the Doc dir topic-pathlib labels May 14, 2024
barneygale added a commit to barneygale/cpython that referenced this issue May 14, 2024
…ib docs

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.
barneygale added a commit to barneygale/cpython that referenced this issue May 24, 2024
barneygale added a commit that referenced this issue May 24, 2024
#119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.
barneygale added a commit to barneygale/cpython that referenced this issue May 24, 2024
Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…ib docs (python#119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336)
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…o pathlib docs (pythonGH-119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`..
(cherry picked from commit 81d6336)

Co-authored-by: Barney Gale <[email protected]>
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…ib docs (python#119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336)
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…o pathlib docs (pythonGH-119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`..
(cherry picked from commit 81d6336)

Co-authored-by: Barney Gale <[email protected]>
barneygale added a commit that referenced this issue Jun 2, 2024
…lib docs (GH-119055) (#119951)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336)
barneygale added a commit that referenced this issue Jun 2, 2024
…lib docs (GH-119055) (#119952)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336)
barneygale added a commit that referenced this issue Jun 2, 2024
…119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 2, 2024
…ocs (pythonGH-119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
(cherry picked from commit bd6d4ed)

Co-authored-by: Barney Gale <[email protected]>
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…ocs (python#119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed)
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
…thlib docs (pythonGH-119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`..
(cherry picked from commit bd6d4ed)

Co-authored-by: Barney Gale <[email protected]>
barneygale added a commit that referenced this issue Jun 2, 2024
…docs (GH-119524) (#119954)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed)

Co-authored-by: Barney Gale <[email protected]>
barneygale added a commit to barneygale/cpython that referenced this issue Jun 2, 2024
Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.
barneygale added a commit that referenced this issue Jun 2, 2024
…docs (GH-119524) (#119955)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed)
mliezun pushed a commit to mliezun/cpython that referenced this issue Jun 3, 2024
…ocs (python#119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
barneygale added a commit to barneygale/cpython that referenced this issue Jun 5, 2024
…ocs (python#119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
barneygale added a commit that referenced this issue Jun 6, 2024
Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

Co-authored-by: Jelle Zijlstra <[email protected]>
barneygale added a commit to barneygale/cpython that referenced this issue Jun 6, 2024
…ython#119956)

Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

Co-authored-by: Jelle Zijlstra <[email protected]>
(cherry picked from commit 14e1506)
barneygale added a commit that referenced this issue Jun 29, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 29, 2024
…H-121158)

(cherry picked from commit 6b280a8)

Co-authored-by: Barney Gale <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 29, 2024
…H-121158)

(cherry picked from commit 6b280a8)

Co-authored-by: Barney Gale <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
barneygale added a commit that referenced this issue Jun 29, 2024
When backporting GH-120505 to 3.12, I accidentally transposed
"Permissions and ownership" into "Ownership and permissions".
Swap it back for consistency with 3.13 and main.
barneygale added a commit that referenced this issue Jun 29, 2024
) (#121169)

GH-119054: Add alt text to pathlib inheritance diagram (GH-121158)
(cherry picked from commit 6b280a8)

Co-authored-by: Barney Gale <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
barneygale added a commit that referenced this issue Jun 29, 2024
) (#121168)

GH-119054: Add alt text to pathlib inheritance diagram (GH-121158)
(cherry picked from commit 6b280a8)

Co-authored-by: Barney Gale <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@barneygale
Copy link
Contributor Author

It's finished! Thank you for all the reviews :)

mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
…lib docs. (python#120186)

Add dedicated subsection for `pathlib.Path.touch()`, `mkdir()`,
`symlink_to()` and `hardlink_to()`. Also note that `open()`, `write_text()`
and `write_bytes()` are often used to create files.

Co-authored-by: Hugo van Kemenade <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
…python#120465)

Add dedicated subsection for `pathlib.Path.rename()`, `replace()`,
`unlink()` and `rmdir()`.
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
…ocs. (python#120505)

Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
…ib docs. (python#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.
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…ocs (python#119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…ython#119956)

Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

Co-authored-by: Jelle Zijlstra <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…lib docs. (python#120186)

Add dedicated subsection for `pathlib.Path.touch()`, `mkdir()`,
`symlink_to()` and `hardlink_to()`. Also note that `open()`, `write_text()`
and `write_bytes()` are often used to create files.

Co-authored-by: Hugo van Kemenade <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…python#120465)

Add dedicated subsection for `pathlib.Path.rename()`, `replace()`,
`unlink()` and `rmdir()`.
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…ocs. (python#120505)

Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…ib docs. (python#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.
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…ib docs (python#119055)

Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…ocs (python#119524)

Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…ython#119956)

Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

Co-authored-by: Jelle Zijlstra <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…lib docs. (python#120186)

Add dedicated subsection for `pathlib.Path.touch()`, `mkdir()`,
`symlink_to()` and `hardlink_to()`. Also note that `open()`, `write_text()`
and `write_bytes()` are often used to create files.

Co-authored-by: Hugo van Kemenade <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…python#120465)

Add dedicated subsection for `pathlib.Path.rename()`, `replace()`,
`unlink()` and `rmdir()`.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…ocs. (python#120505)

Add dedicated subsection for `pathlib.owner()`, `group()`, `chmod()` and
`lchmod()`.

Co-authored-by: Hugo van Kemenade <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…ib docs. (python#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.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-pathlib
Projects
None yet
Development

No branches or pull requests

2 participants