Title: Rephrase general rules for comparison of objects · Issue #141218 · python/cpython · GitHub
Open Graph Title: Rephrase general rules for comparison of objects · Issue #141218 · python/cpython
X Title: Rephrase general rules for comparison of objects · Issue #141218 · python/cpython
Description: Right now we have this in docs: Objects of different types, except different numeric types, never compare equal. This is not true for a long time, e.g. frozenset's vs set's - another exception: Python 3.14.0 (tags/v3.14.0:ebf955df7a8, Oc...
Open Graph Description: Right now we have this in docs: Objects of different types, except different numeric types, never compare equal. This is not true for a long time, e.g. frozenset's vs set's - another exception: Pyt...
X Description: Right now we have this in docs: Objects of different types, except different numeric types, never compare equal. This is not true for a long time, e.g. frozenset's vs set's - another except...
Opengraph URL: https://github.com/python/cpython/issues/141218
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rephrase general rules for comparison of objects","articleBody":"Right now we have [this](https://docs.python.org/3.14/library/stdtypes.html#comparisons) in docs:\n\u003e Objects of different types, except different numeric types, never compare equal.\n\nThis is not true for a long time, e.g. frozenset's vs set's - another exception:\n```pycon\nPython 3.14.0 (tags/v3.14.0:ebf955df7a8, Oct 15 2025, 06:24:48) [GCC 12.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e frozenset([1, 2]) == {1, 2}\nTrue\n```\nIn the relevant place of docs its [documented](https://docs.python.org/3.14/library/stdtypes.html#set):\n\u003e Both [set](https://docs.python.org/3.14/library/stdtypes.html#set) and [frozenset](https://docs.python.org/3/library/stdtypes.html#frozenset) support set to set comparisons. Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal).\n\u003e\n\u003e Instances of [set](https://docs.python.org/3.14/library/stdtypes.html#set) are compared to instances of [frozenset](https://docs.python.org/3.14/library/stdtypes.html#frozenset) based on their members.\n\nbut we should adjust also the generic texts, something like:\n\u003e Objects of different types, unless documented otherwise, never compare equal.\n\nPS: https://discuss.python.org/t/104658/\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-141221\n* gh-142810\n* gh-142811\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2025-11-08T00:05:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/141218/cpython/issues/141218"}
| 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:ea9a4405-4f10-b95e-4195-22c17bbfc3ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCDA:108F59:50706FE:7140C53:6A5021E4 |
| html-safe-nonce | c9096024676c37b2896534cf7045e6d5eb4d26ffd800973bc437e3bf75912e56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0RBOjEwOEY1OTo1MDcwNkZFOjcxNDBDNTM6NkE1MDIxRTQiLCJ2aXNpdG9yX2lkIjoiNDQ0ODQ3MzI2NDM0ODQ3MTc4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9e823902b265455060e19d94440ea165ee31254aa335ab5d6b0ab60659ab42f6 |
| hovercard-subject-tag | issue:3602427632 |
| 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/141218/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f1c2a8c15168782327e2102694129cd2da4c20181dc53bde680f3b8f4fe12b33/python/cpython/issues/141218 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f1c2a8c15168782327e2102694129cd2da4c20181dc53bde680f3b8f4fe12b33/python/cpython/issues/141218 |
| og:image:alt | Right now we have this in docs: Objects of different types, except different numeric types, never compare equal. This is not true for a long time, e.g. frozenset's vs set's - another exception: Pyt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | a08040246389072795e3b4e7b33c6d9a0c564eee02e829a809326d67c418b069 |
| 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 | d1b91b18e7330fc458dfd824c61eaed7daa830d6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width