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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:3d6fd33d-3c49-f240-5924-2b296544d71b |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 851E:320F8E:22A57F7:2F047E5:696ACECB |
| html-safe-nonce | bf260325f35a5d6fdb7086ea13f78873c063ceb3f864a3cca031971e5d9f95d4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTFFOjMyMEY4RToyMkE1N0Y3OjJGMDQ3RTU6Njk2QUNFQ0IiLCJ2aXNpdG9yX2lkIjoiNzAyNDk2MjMyNzczOTU1MTQzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0a29bc1515947d46f1f1d7f85073c6ae288db08fb9892023776f19cc08229df1 |
| hovercard-subject-tag | pull_request:3050337811 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| turbo-cache-control | no-cache |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width