Skip to content

gh-158798: Replace misleading "hashable collections" in object.__hash… - #162077

Open
themythofsisyphusjayant wants to merge 1 commit into
python:mainfrom
themythofsisyphusjayant:fix-gh-158798-hashable-collections
Open

themythofsisyphusjayant wants to merge 1 commit into
python:mainfrom
themythofsisyphusjayant:fix-gh-158798-hashable-collections

Conversation

@themythofsisyphusjayant

@themythofsisyphusjayant themythofsisyphusjayant commented Nov 16, 2026 •

Copy link
Copy Markdown

The object.__hash__ docs said instances "will not be usable as items in hashable collections" and that "the implementation of hashable collections requires that a key's hash value is immutable". The glossary defines "hashable" as a property of an object, so "hashable collections" reads as "collections that can be hashed" — but set and dict are not hashable in that sense. What is meant is collections that use hashing internally.

This rewords both spots in Doc/reference/datamodel.rst to "collections of hashable objects", keeping the glossary link (as requested in the issue discussion). The first paragraph's "hashed collections" is left unchanged.

Checked by building the page with Sphinx (9.1.1, from Doc/requirements.txt): the page renders with the new wording at both spots and the old phrase nowhere. The only build warnings are pre-existing single-file-build artifacts, identical before and after the change.

Disclosure: I used an AI coding assistant to help prepare this change, and reviewed the diff myself before submitting.

@python-cla-bot

python-cla-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35915723 | 📁 Comparing cf341ed against main (7c59816)

  🔍 Preview build  

1 file changed
± reference/datamodel.html

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant