GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow the `f_func` field of the `_PyInterpreterFrame` struct to be any object (and rename it) · Issue #96237 · python/cpython

Allow the f_func field of the _PyInterpreterFrame struct to be any object (and rename it) #96237

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Allow the f_func field of the _PyInterpreterFrame struct to be any object (and rename it)#96237
Copy link
Labels
performancePerformance or resource usagePerformance or resource usage

Description

@markshannon
markshannon
opened on Aug 24, 2022
Issue body actions

In order to better support shim frames, trampolines, Cython frames and other such bits and pieces, we need to relax the requirement that the f_func field is a function.
The only reason for it to be a function is that it needs to hold a strong reference to builtins and globals, as the frame only has a borrowed reference to those. Any object with those references will do.
In fact, for code that has no builtins or globals (many shims and trampolines) there is no need for those references and f_func could even be None.

Activity

  1. markshannon
    added
    performancePerformance or resource usagePerformance or resource usage
    on Aug 24, 2022
  2. iritkatriel commented on Aug 24, 2022

    @iritkatriel
    iritkatriel
    on Aug 24, 2022
    Member
    More actions

    Does it really need to allow any object? Could you instead define a small number of object types that it can be?

  3. markshannon commented on Aug 24, 2022

    @markshannon
    markshannon
    on Aug 24, 2022
    MemberAuthor
    More actions

    I don't see any advantage to restricting the possible types. Allowing any object is no worse for any code reading from f_funcobj and more flexible for anything storing to it.

    Given the values of f_globals and f_builtins can no longer be trusted, I think I'll make them void * just to make it clear that if you didn't set them, then you can't trust them.

    Reacted by Irit Katriel
  4. markshannon
    added a commit that references this issue on Aug 25, 2022

    GH-96237: Allow non-functions as reference-holder in frames. (GH-96238)

    c09fa75
  5. carljm commented on Feb 14, 2023

    @carljm
    carljm
    on Feb 14, 2023
    Member
    More actions

    Currently whatever is in f_funcobj also needs to have a func_closure. #101310 demonstrates one way to remove this requirement.

  6. carljm commented on Feb 14, 2023

    @carljm
    carljm
    on Feb 14, 2023
    Member
    More actions

    Should this issue be closed, given the attached PR was merged? Or is there more planned here?

  7. markshannon commented on Apr 3, 2023

    @markshannon
    markshannon
    on Apr 3, 2023
    MemberAuthor
    More actions

    Superseded by #100987

  8. markshannon
    closed this as not plannedon Apr 3, 2023
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

    performancePerformance or resource usagePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.