expose CELL status of a symbol in symtable
Offen
Dieses Issue hat noch niemand übernommen.
stdlib
type-feature
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature or enhancement
Proposal:
symtable symbols have the following predicates, but for some reason no is_cell. Is there a reason for this, or should we expose is_cell as well?
'is_annotated', 'is_assigned', 'is_declared_global', 'is_free', 'is_global', 'is_imported', 'is_local', 'is_namespace', 'is_nonlocal', 'is_parameter', 'is_referenced'
The symbol obviously knows whether it's a cell:
>>> st.get_children()[0].get_symbols()[0]._scope_str
<bound method Symbol._scope_str of <symbol 'x': CELL, USE|DEF_LOCAL>>
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-143549
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 den im Issue aufgeführten symtable-Symbol-Prädikaten und untersuche, wie das Symbol seinen internen CELL-Scope meldet. Das Issue verlinkt PR gh-143549, daher prüfe diese Arbeit zuerst. Fertig ist die Aufgabe, wenn der CELL-Status über die symtable API konsistent mit den bestehenden Prädikaten offengelegt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100