Reorganize `os.path` documentation
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 35.9k
- Métriques de merge des PR
- Métriques de PR en attente
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la page de documentation de os.path et examinez les entrées abspath, isabs, split et join indiquées dans l’issue. Consultez les PRs liés avant de commencer, puis déterminez si la direction retenue est une réorganisation ou l’ajout de liens seealso et d’exemples. C’est terminé lorsque les références choisies sont faciles à suivre et que le comportement de join avec les chemins absolus est expliqué explicitement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100