Clarify module.__file__ documentation in the data model reference
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Documentation
The module.__file__ section in Doc/reference/datamodel.rst has two problems:
- it says "Both attributes should be a
str" even though the section is describing a single attribute - it does not clearly explain the path form readers should expect from
__file__
The docs should say that __file__ is optional, should be a str when set, and is usually an absolute path for modules loaded from a file by the import system, while callers that require an absolute path should normalize it explicitly.
Linked PRs
- gh-150273
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Öffne den Abschnitt zu module.file in Doc/reference/datamodel.rst und überprüfe seine aktuelle Formulierung anhand der Anforderungen des Issues. Erledigt ist die Aufgabe, wenn der Text das Attribut als optional beschreibt, str und das übliche Verhalten mit absoluten Pfaden nennt und darauf hinweist, dass Aufrufer, die einen absoluten Pfad benötigen, ihn explizit normalisieren sollten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 25/100