Get rid of fake TypeInfo's for TypedDicts
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
We currently create fake TypeInfos to store TypedDicts. This used to cause various issues, in particular, currently the type of a TypedDict "class object" in runtime context is () -> SomeTypedDict, where the return type is an instance of the fake TypeInfo.
We can probably fix latter by just constructing a reasonable type, but a more global solution would be to get rid of the fake TypeInfo entirely. It is not needed for anything and just complicates things. We will need to put some symbol node in the symbol table, so we would need a new SymbolNode subclass (or reuse TypeAlias, so a TypedDict definition A = TypedDict('A' {'x': int, 'y': int}) will be very similar to A = Dict[str, int]).
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 damit nachzuverfolgen, wo TypedDict-Definitionen künstliche TypeInfos erzeugen und wie ihre Symbole in der Symboltabelle gespeichert werden. Prüfe eine neue SymbolNode-Unterklasse oder eine TypeAlias-Darstellung und verifiziere anschließend, dass TypedDicts keine künstlichen TypeInfos mehr benötigen und dass ihr Klassentyp als Objekt im Laufzeitkontext sinnvoll ist.
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
- 30/100