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 — Document FrameLocalsProxy behaviour quirks · Issue #125731 · python/cpython

Document FrameLocalsProxy behaviour quirks #125731

New issue
Copy link
New issue
Copy link
Open
#157869
Open
Document FrameLocalsProxy behaviour quirks#125731
#157869
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

Description

@ncoghlan
ncoghlan
opened on Oct 19, 2024
Issue body actions

Following PEP 667, https://docs.python.org/dev/reference/datamodel.html#frame-objects mentions that frame.f_locals may be a write-through proxy object, but doesn't really explain what that means.

Once python/peps#3845 lands PEP 667 will contain such a description, but the main docs should at least cover the key behaviours:

  • new instance on every attribute access
  • two proxies with the same keys and values will still be unequal if they refer to different frames
  • extra keys can be stored and are stored on the frame itself so they're shared across all proxies for the same frame
  • keys corresponding to local variables can't be deleted
  • .copy() (and any other API that produces a new container) returns a regular dict instance

Suggested location would be as a new 4th subsection under the frame objects section linked above. A "see also" from that new subsection back to PEP 667 would also be a useful addition.

Linked PRs

  • gh-125731: Document FrameLocalsProxy behaviour quirks in datamodel.rst #157869

Activity

  1. ncoghlan
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    on Oct 19, 2024
  2. python
    deleted a comment from on Oct 21, 2024
  3. willingc
    added this to docs issueson Oct 31, 2024
  4. github-project-automation
    moved this to Todo in docs issueson Oct 31, 2024
  5. VimalN2005 commented on Sep 10, 2026

    @VimalN2005
    VimalN2005
    on Sep 10, 2026
    More actions

    Hi @ncoghlan,

    I would like to work on this issue. I have reviewed the requirements and drafted the new subsection under the Frame Objects section in Doc/reference/datamodel.rst covering the 5 key proxy behaviors you listed, along with a seealso reference to PEP 667.

    May I go ahead and open a pull request for this?

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

    3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    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.