Title: gh-141805: avoid increase the set->used twice when the __eq__ trigger another add by kemingy · Pull Request #142007 · python/cpython · GitHub
Open Graph Title: gh-141805: avoid increase the set->used twice when the __eq__ trigger another add by kemingy · Pull Request #142007 · python/cpython
X Title: gh-141805: avoid increase the set->used twice when the __eq__ trigger another add by kemingy · Pull Request #142007 · python/cpython
Description: gh-141805: goes directly to the found_unused_or_dummy when finding a dummy slot in set.add This avoids triggering the __eq__ in the next iteration by the PyObject_RichCompareBool, which might introduce another set.add in the user code. Like: tasks = set() class Corrupt: def __eq__(self, value): tasks.add(self) return False As described in #141805 (comment)
Open Graph Description: gh-141805: goes directly to the found_unused_or_dummy when finding a dummy slot in set.add This avoids triggering the __eq__ in the next iteration by the PyObject_RichCompareBool, which might intro...
X Description: gh-141805: goes directly to the found_unused_or_dummy when finding a dummy slot in set.add This avoids triggering the __eq__ in the next iteration by the PyObject_RichCompareBool, which might intro...
Opengraph URL: https://github.com/python/cpython/pull/142007
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f294df60-1cfa-7cbb-e6da-ab3063905352 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9C32:19BAB9:635B5F:834B56:696B4756 |
| html-safe-nonce | 4fd04793fdd446f20eaa8287e816ee4ea518f5fe61966c722e2952a32e07127c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzMyOjE5QkFCOTo2MzVCNUY6ODM0QjU2OjY5NkI0NzU2IiwidmlzaXRvcl9pZCI6IjE4MDkyODQ1OTMzMDMxMTE1MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8ad2c11138dd6928c6b5a87c3bd0448b369d2873715b880423bdac7e0322aeeb |
| hovercard-subject-tag | pull_request:3050337811 |
| 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/142007/files |
| twitter:image | https://avatars.githubusercontent.com/u/12974685?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12974685?s=400&v=4 |
| og:image:alt | gh-141805: goes directly to the found_unused_or_dummy when finding a dummy slot in set.add This avoids triggering the __eq__ in the next iteration by the PyObject_RichCompareBool, which might intro... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width