The IDENTIFIERS list in Tools/scripts/generate_global_objects.py is a slight burden
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 558
Beschreibung
(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
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
Beginne mit Tools/scripts/generate_global_objects.py und konzentriere dich auf iter_global_strings() und die manuell gepflegte IDENTIFIERS-Liste. Verfolge, wie das Skript C-Quelldateien nach _Py_ID() und _Py_DECLARE_STR() durchsucht, und ermittle anschließend, wie indirekt verwendete Namen erkannt werden können. Die Aufgabe ist abgeschlossen, wenn indirekt verwendete globale Strings keine manuellen Ergänzungen mehr erfordern und die Generierung weiterhin korrekt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- build-system, tooling
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100