python / python/cpython

The IDENTIFIERS list in Tools/scripts/generate_global_objects.py is a slight burden

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

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

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

説明

(This is partly inspired by gh-94706.)

In generate_global_objects.py, iter_global_strings() detects global strings by looking for _Py_ID() and _Py_DECLARE_STR() in the C source files. In some places those macros are used indirectly, which means the corresponding strings won't be detected by iter_global_strings().

Currently we manually add such strings to the IDENTIFIERS list at the top of the script. Before we added the discovery mechanism in iter_global_strings(), basically all the static strings were in this list. However, we found that there were several maintenance/development downsides to the manual list, so we added iter_global_strings(). At the time we didn't take the extra step of automating discovery of indirectly used names. We should address this.

CC @kumaraditya303

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

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

はじめの一歩

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

調査の方向性

Tools/scripts/generate_global_objects.py から始め、iter_global_strings() と手動で管理されている IDENTIFIERS リストに焦点を当てます。スクリプトが C ソースファイルを走査して _Py_ID() と _Py_DECLARE_STR() を検索する方法を追跡し、間接的に使用されている名前を発見する方法を特定します。間接的に使用されているグローバル文字列に手動で追加する必要がなくなり、生成が引き続き正しく行われれば完了です。

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

評価

技術スタック
c, python
領域
build-system, tooling
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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