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 — gh-125731: Document FrameLocalsProxy behaviour quirks in datamodel.rst by VimalN2005 · Pull Request #157869 · python/cpython

Conversation

@VimalN2005

@VimalN2005 VimalN2005 commented Sep 20, 2026

Copy link
Copy Markdown

What's changed?

Fixes gh-125731.

This PR documents the key behaviours of the write-through FrameLocalsProxy object returned by frame.f_locals in optimized scopes under Doc/reference/datamodel.rst, following PEP 667 and the requirements outlined by @ncoghlan:

  • Adds a new 4th subsection Frame locals proxy behaviour under the Frame Objects section.
  • Documents the 5 key proxy behaviours:
    1. A new proxy instance is returned on every access to frame.f_locals.
    2. Two proxy instances with the same keys and values compare unequal if they refer to different frame objects.
    3. Extra keys can be stored in the proxy and are stored on the frame itself, shared across all proxies for that frame.
    4. Keys corresponding to local variables defined in the function cannot be deleted (KeyError).
    5. Calling .copy() returns a standard dict instance.
  • Adds a .. seealso:: linking to PEP 667.
  • Links frame.f_locals attribute documentation directly to this new subsection.

Documentation-only change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@VimalN2005
pythongh-125731: Document FrameLocalsProxy behaviour quirks in datamo…
07c0e79
…del.rst
@VimalN2005
VimalN2005 requested review from AA-Turner and willingc as code owners September 20, 2026 17:31
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Sep 20, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Sep 20, 2026
Document FrameLocalsProxy behaviour quirks #125731
Open
@bedevere-app bedevere-app Bot added the awaiting review label Sep 20, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Sep 20, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Sep 20, 2026
@read-the-docs-community

read-the-docs-community Bot commented Sep 20, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34662367 | 📁 Comparing 07c0e79 against main (a64b7ec)

  🔍 Preview build  

1 file changed
± reference/datamodel.html
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@willingc willingc Awaiting requested review from willingc willingc is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Document FrameLocalsProxy behaviour quirks

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@VimalN2005
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.