Title: [3.7] bpo-40895: Update weakref documentation to remove old warnings (GH-20687) by pitrou · Pull Request #20793 · python/cpython · GitHub
Open Graph Title: [3.7] bpo-40895: Update weakref documentation to remove old warnings (GH-20687) by pitrou · Pull Request #20793 · python/cpython
X Title: [3.7] bpo-40895: Update weakref documentation to remove old warnings (GH-20687) by pitrou · Pull Request #20793 · python/cpython
Description: The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to the problem of dictionary mutation during iteration. These notes present the user with a problem that has no easy solution. I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an _IterationGuard context manager to the implementation, which delays mutation while an iteration is in progress. I asked for confirmation and @pitrou agreed that these notes could be removed: c1baa601e2b558deb690edfdf334fceee3b03327GH-commitcomment-39514438. (cherry picked from commit 1642c0e) Co-authored-by: Daniel Fortunov asqui@users.noreply.github.com https://bugs.python.org/issue40895 Automerge-Triggered-By: @pitrou
Open Graph Description: The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to the problem of dictionary mutation during iter...
X Description: The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to the problem of dictionary mutation during iter...
Opengraph URL: https://github.com/python/cpython/pull/20793
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8b7a00e8-9a94-e8ca-c428-9a574acd36b5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 878C:C58FE:7C8F8C:AA33D6:6A593043 |
| html-safe-nonce | 8ffb7c3b26a0fe17e590c000206851037b11f0256f374fe6445c896d3812b166 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzhDOkM1OEZFOjdDOEY4QzpBQTMzRDY6NkE1OTMwNDMiLCJ2aXNpdG9yX2lkIjoiNjc3NDMxNTM0MjA5OTk4NDQ1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b44944e6e44e2b0d98b00042e27f9706b6f6f02f1a30355ed398cd327cd49a8b |
| hovercard-subject-tag | pull_request:432684204 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/20793/files |
| twitter:image | https://avatars.githubusercontent.com/u/1721820?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1721820?s=400&v=4 |
| og:image:alt | The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to the problem of dictionary mutation during iter... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9713946e7d87c4b631b5230769f749551d20527cc4872e8f1d2ec6a11bead090 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 858568d2992d2e6aac25cc4ebf5b46c83bbfd745 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width