python / python/cpython

Improve interface between compiler and symtable

Offen
#122,985 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

interpreter-core type-feature
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
36k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

In this issue I want to try and improve the interface between the compiler and the symtable.

Problems I see are:

  • the compiler modifies the symtable
  • the compiler performs calculations that the symtable could do (such as in push_inlined_comprehension_state)
  • the symtable is actually not a correct representation of some scopes, like those of inlined comprehensions (the comprehension scope it removed from the symtable tree, but is still access from the compiler via the symtable dict). Exception handlers are another example of scope changes that the compiler does, which are not reflected in the symtable.
Linked PRs
  • gh-122986

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Lesen der Implementierungen von compiler und symtable und konzentriere dich dabei auf push_inlined_comprehension_state sowie auf die Behandlung von inlined comprehensions und Exception-Handlern. Als erledigt gilt die Herstellung einer saubereren Schnittstelle, bei der compiler symtable nicht verändert, im Besitz von symtable befindliche Berechnungen dorthin verschoben werden und Änderungen des Scopes konsistent dargestellt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
compilers
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.