python / python/cpython

Replace `#` comments with modern docstrings when possible

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

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

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

説明

In string.Formatter.{parse,get_field}, we use simple # comments to document methods. While it's picked up by pydoc (through inspect.getcomments()), it's not picked up by IDEs. I suggest we cleanup those occurrences to improve code readability as well. I stumbled upon it by chance so there might be other places that need such cleanup.

[!IMPORTANT]
Only comments that are above a def of a public function should be considered. Comments inside the function body or method body should be considered separately as it could also mean that the public API is incompletely documented on purpose (see https://github.com/python/cpython/issues/134082#issuecomment-2887461014 and following).

Both reports parse private files as well as they can be re-exported to a public API. We still need to go through each occurrences to check if they are expected to be exposed or not (and thus the task is NOT an easy task for newcomers).

Linked PRs
  • gh-134083
  • gh-134096
  • gh-134125

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

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

はじめの一歩

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

調査の方向性

string.Formatter.parse と get_field の上にあるコメントから始め、次に issue にリンクされている public API のレポートと完全なレポートを確認します。報告された各箇所について、private 名が再エクスポートされているかどうかも含め、public function の上にあるコメントに関するルールに照らして確認します。適切な箇所で modern docstring が使用され、意図的に残されたコメントは変更されていない状態を完了とします。リンクされている PR gh-134083、gh-134096、gh-134125 では、関連する作業がすでに対応されています。

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

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

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

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