Skip to content

Specialized subscript guards should require non-negative compact ints #153486

Description

@KRRT7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions