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
The specialized
intsubscript fast paths currently assume a non-negative compactint, 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] = valueThis 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