python / python/cpython

Clarify module.__file__ documentation in the data model reference

オープン
#150,274 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Doc/reference/datamodel.rst の module.file セクションを開き、issue の要件に照らして現在の文言を確認してください。テキストがこの属性をオプションとして説明し、str と通常の絶対パスの動作を明記し、絶対パスが必要な呼び出し元は明示的に正規化すべきだと述べていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。