Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-141218: Fix inaccurate object comparison documentation#141221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mohsinm-dev wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
frommohsinm-dev:fix-gh-141218-object-comparison-docs

Conversation

@mohsinm-dev
Copy link
Contributor

@mohsinm-devmohsinm-dev commentedNov 8, 2025
edited by github-actionsbot
Loading

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

  • UpdatedDoc/library/stdtypes.rst line 167
  • Added news entry inMisc/NEWS.d/next/Documentation/

Test plan

  • Documentation builds successfully withmake 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.


📚 Documentation preview 📚:https://cpython-previews--141221.org.readthedocs.build/

Changed "Objects of different types, except different numeric types, nevercompare equal" to "Objects of different types, unless documented otherwise,never compare equal" to account for documented exceptions like set/frozensetcomparisons.
@python-cla-bot
Copy link

python-cla-botbot commentedNov 8, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

Fix inaccurate documentation about object comparison. Changed "Objects of different
types, except different numeric types, never compare equal" to "Objects of different
types, unless documented otherwise, never compare equal" to account for documented
exceptions like set/frozenset comparisons. No newline at end of file
Copy link
Contributor

@OTheDevOTheDevNov 8, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
exceptions like set/frozenset comparisons.
exceptions like set/frozenset comparisons.

To fix the lint error

@skirpichev
Copy link
Contributor

I suggest just revert news. Its usually not required for docs changes.

OTheDev, mohsinm-dev, and serhiy-storchaka reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@OTheDevOTheDevOTheDev left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@mohsinm-dev@skirpichev@OTheDev

[8]ページ先頭

©2009-2025 Movatter.jp