Title: Document FrameLocalsProxy behaviour quirks · Issue #125731 · python/cpython · GitHub
Open Graph Title: Document FrameLocalsProxy behaviour quirks · Issue #125731 · python/cpython
X Title: Document FrameLocalsProxy behaviour quirks · Issue #125731 · python/cpython
Description: 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 ...
Open Graph Description: 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. O...
X Description: 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 mean...
Opengraph URL: https://github.com/python/cpython/issues/125731
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document FrameLocalsProxy behaviour quirks","articleBody":"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. \r\n\r\nOnce https://github.com/python/peps/pull/3845 lands PEP 667 will contain such a description, but the main docs should at least cover the key behaviours:\r\n\r\n* new instance on every attribute access\r\n* two proxies with the same keys and values will still be unequal if they refer to different frames\r\n* extra keys can be stored and are stored on the frame itself so they're shared across all proxies for the same frame\r\n* keys corresponding to local variables can't be deleted\r\n* `.copy()` (and any other API that produces a new container) returns a regular `dict` instance\r\n\r\nSuggested 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.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157869\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ncoghlan","@type":"Person","name":"ncoghlan"},"datePublished":"2024-10-19T14:48:49Z","url":"https://github.com/python/cpython/issues/125731"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9be79ee8-bf38-e64b-993c-fb07712848cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B76C:2F543F:2A66940:37A9574:6B0277D2 |
| html-safe-nonce | 3c01bea47ed582744d71af9da5e704db1328b3d0277e9a794039ab8d87bf5213 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzZDOjJGNTQzRjoyQTY2OTQwOjM3QTk1NzQ6NkIwMjc3RDIiLCJ2aXNpdG9yX2lkIjoiMjg5NTUwNTM5NzU2MzY4NDgxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 979ea51e9d5f772febc3c698c15b782284d02d00cc5505f756442cb02108c737 |
| hovercard-subject-tag | issue:2599260187 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/125731/issue_layout |
| twitter:image | https://opengraph.githubassets.com/93d5da12cdd7e3945b85ec067403366e4e2244c2867f361b9a9bc3ddf7f32b0e/python/cpython/issues/125731 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/93d5da12cdd7e3945b85ec067403366e4e2244c2867f361b9a9bc3ddf7f32b0e/python/cpython/issues/125731 |
| og:image:alt | 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. O... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ncoghlan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width