python / python/cpython

Reorganize `os.path` documentation

Offen
#130,536 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

docs easy
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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.join without a link.
  • os.path.isabs could backlink to os.path.abspath.
  • os.path.split mentions os.path.join but 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Dokumentationsseite zu os.path und überprüfe die im Issue aufgeführten Einträge für abspath, isabs, split und join. Sieh dir die verknüpften PRs an, bevor du beginnst, und ermittle dann, ob die akzeptierte Richtung eine Neuorganisation oder das Hinzufügen von seealso-Links und Beispielen ist. Als abgeschlossen gilt die Aufgabe, wenn die ausgewählten Verweise leicht nachzuvollziehen sind und das Verhalten von join bei absoluten Pfaden ausdrücklich erklärt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.