Title: gh-141218: Fix inaccurate object comparison documentation by mohsinm-dev · Pull Request #141221 · python/cpython · GitHub
Open Graph Title: gh-141218: Fix inaccurate object comparison documentation by mohsinm-dev · Pull Request #141221 · python/cpython
X Title: gh-141218: Fix inaccurate object comparison documentation by mohsinm-dev · Pull Request #141221 · python/cpython
Description: Summary Fixes issue #141218 by correcting inaccurate documentation about object comparison. Problem: The current documentation states "Objects of different types, except different numeric types, never compare equal" which is factually incorrect. Counter-example: >>> frozenset([1, 2]) == {1, 2} True Solution: Changed to "Objects of different types, unless documented otherwise, never compare equal" to account for all documented exceptions. Documented exceptions include: Numeric types (int, float, complex) - already mentioned set/frozenset comparisons - documented later in same file dict subclass comparisons (defaultdict, Counter, OrderedDict) Changes Updated Doc/library/stdtypes.rst line 167 Added news entry in Misc/NEWS.d/next/Documentation/ Test plan Documentation builds successfully with make html Verified change maintains consistency with existing specific type documentation Tested that the issue examples work as described Confirmed change is minimal and maintains readability The fix improves documentation accuracy while maintaining clarity and consistency. Issue: gh-141218 📚 Documentation preview 📚: https://cpython-previews--141221.org.readthedocs.build/
Open Graph Description: Summary Fixes issue #141218 by correcting inaccurate documentation about object comparison. Problem: The current documentation states "Objects of different types, except different numeric type...
X Description: Summary Fixes issue #141218 by correcting inaccurate documentation about object comparison. Problem: The current documentation states "Objects of different types, except different numeric ...
Opengraph URL: https://github.com/python/cpython/pull/141221
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f20c7789-c2e8-67e1-3422-2ff8ee3fb815 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DAD4:1F14:48EC13A:661BD9E:6A510BF9 |
| html-safe-nonce | ae8dad20ff0150c2be2285ee884a8aceff869264254248cd0834cfa70bef8f92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUQ0OjFGMTQ6NDhFQzEzQTo2NjFCRDlFOjZBNTEwQkY5IiwidmlzaXRvcl9pZCI6IjUzNjk0NzIxNjk5Njg0NzEwMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e9a924aa80232a93fa58c3290f64fb9544b82a2f49225bd3dfb5d71c74e5f683 |
| hovercard-subject-tag | pull_request:2990905521 |
| 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/141221/files |
| twitter:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| og:image:alt | Summary Fixes issue #141218 by correcting inaccurate documentation about object comparison. Problem: The current documentation states "Objects of different types, except different numeric type... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d |
| 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 | 2d129404fc45ea64edb1b98567c53e55b395536f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width