Reorganize `os.path` documentation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
The os.path documentation is alphabetically sorted. That's great because it's easy to find a function. However, this also means that functions shouldn't reference other functions documented later as the reader may not have been aware of them before.
An alternative is to reorganize the documentation page so that we put at the top the most used functions such as os.path.join. The latter caused a bit of confusion in gh-130527, where neither the OP nor me remembered that os.path.join("/a", "/b") == "/b".
If reorganizing the documentation is not preferred, we should at least add .. seealso:: directives and clickable links so that any function mentioned but not yet documented at the time of reading can be easily looked up.
- os.path.abspath contains a reference to
os.path.joinwithout a link. - os.path.isabs could backlink to
os.path.abspath. - os.path.split mentions
os.path.joinbut as it's far away, we could backlink it. - os.path.join mentions "If a segment is an absolute path (which on Windows requires both a drive and a root), then all previous segments are ignored and joining continues from the absolute path segment.". We should add an example as it would be more explicit and teaching (e.g.,
os.path.join("/home/foo", "/home/bar") == "/home/bar".
Linked PRs
- gh-130557
- gh-131872
- gh-132408
- gh-142800
- gh-142801
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the os.path documentation page and review the entries for abspath, isabs, split, and join listed in the issue. Check the linked PRs before starting, then determine whether the accepted direction is reorganization or added seealso links and examples. Done means the chosen references are easy to follow and the absolute-path join behavior is explained explicitly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100