Skip to content

Use borrowed references for LOAD_CONST #134282

Closed
@markshannon

Description

@markshannon

Feature or enhancement

Proposal:

We now support borrowed (tagged) references on the stack. Like LOAD_FAST_BORROW we can use borrowed references in LOAD_CONST as the value in the constants array is guaranteed to outlive any variables in the frame.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

added a commit that references this issue on May 20, 2025

GH-134282: Always borrow references LOAD_CONST (GH-134284)

6dcb0fd
added a commit that references this issue on May 26, 2025

pythonGH-134282: Always borrow references LOAD_CONST (pythonGH-134284)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Use borrowed references for `LOAD_CONST` · Issue #134282 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant