Specialized subscript guards should require non-negative compact ints
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the specialized int subscript fast paths for list[i], tuple[i], str[i], and list[i] = value. Check how their guards express the compact-int precondition and how negative indices reach the fallback path. Done means the guards require non-negative compact ints, redundant specialized-body checks are removed, and negative-index behavior is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100