Specialized subscript guards should require non-negative compact ints
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
The specialized int subscript fast paths currently assume a non-negative compact int, but that precondition is not expressed directly in the guard.
Make the guard explicit for the affected cases:
list[i]tuple[i]str[i]list[i] = value
This aligns the guard with the existing specialization contract and removes redundant checks from the specialized bodies, without changing the fallback path for negative indices.
Linked PRs
- gh-153487
- gh-153523
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, die spezialisierten int-Subscript-Fastpaths für list[i], tuple[i], str[i] und list[i] = value zu lokalisieren. Prüfe, wie ihre Guards die compact-int-Vorbedingung ausdrücken und wie negative Indizes den Fallback-Pfad erreichen. Fertig ist die Arbeit, wenn die Guards nichtnegative compact ints erfordern, redundante Prüfungen im spezialisierten Body entfernt sind und das Verhalten bei negativen Indizes unverändert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- compilers, performance
- Issue-Typ
- Refactoring
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 25/100