Title: weakset isdisjoint misses an equal temporary object · Issue #162523 · python/cpython · GitHub
Open Graph Title: weakset isdisjoint misses an equal temporary object · Issue #162523 · python/cpython
X Title: weakset isdisjoint misses an equal temporary object · Issue #162523 · python/cpython
Description: Bug report the iterator yields a temporary object equal to a live member of the set. both calls should return false, but the weak set returns true. from collections import UserString from weakref import WeakSet item = UserString('a') pri...
Open Graph Description: Bug report the iterator yields a temporary object equal to a live member of the set. both calls should return false, but the weak set returns true. from collections import UserString from weakref i...
X Description: Bug report the iterator yields a temporary object equal to a live member of the set. both calls should return false, but the weak set returns true. from collections import UserString from weakref i...
Opengraph URL: https://github.com/python/cpython/issues/162523
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"weakset isdisjoint misses an equal temporary object","articleBody":"### Bug report\n\nthe iterator yields a temporary object equal to a live member of the set. both calls should return false, but the weak set returns true.\n\n```python\nfrom collections import UserString\nfrom weakref import WeakSet\n\nitem = UserString('a')\nprint(WeakSet([item]).isdisjoint(map(UserString, 'a'))) # True\nprint(set([item]).isdisjoint(map(UserString, 'a'))) # False\n```\n\n### CPython versions tested on:\n\n3.16\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-162524\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/tonghuaroot","@type":"Person","name":"tonghuaroot"},"datePublished":"2026-11-24T03:22:33Z","url":"https://github.com/python/cpython/issues/162523"}
| 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:a798ef9c-4383-9b84-3672-6dc929f974d9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A06A:D7B8A:FB3595:14CE368:6B064C08 |
| html-safe-nonce | 4035bb113922f7273f1727adab0cc3e0b10e1ce911c88ccf4478c347531bc92c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDZBOkQ3QjhBOkZCMzU5NToxNENFMzY4OjZCMDY0QzA4IiwidmlzaXRvcl9pZCI6IjI1Mzc0Nzc0MjYyODA1NDkzODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 17a4ba3dae3239bc179e62b0d1f1a5d68c3de4979c3c3e48531e1ce03b87c112 |
| hovercard-subject-tag | issue:6573885704 |
| 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/162523/issue_layout |
| twitter:image | https://opengraph.githubassets.com/595df5440704c7285fd552e96a227ac3e7c32efcca202a8bde3380c743b4634d/python/cpython/issues/162523 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/595df5440704c7285fd552e96a227ac3e7c32efcca202a8bde3380c743b4634d/python/cpython/issues/162523 |
| og:image:alt | Bug report the iterator yields a temporary object equal to a live member of the set. both calls should return false, but the weak set returns true. from collections import UserString from weakref i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tonghuaroot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e |
| 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 | f1f9a08f7c769a37f1dfc18ad43d463c222a7eea |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width