]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] Mention `frozendict` in `object.__hash__()` documentation (GH-148867) (#151077)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 8 Jun 2026 11:47:55 +0000 (13:47 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Jun 2026 11:47:55 +0000 (11:47 +0000)
(cherry picked from commit e3762114e514f7790e9b4cf3a7b9478f2f306901)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Doc/reference/datamodel.rst

index a8614128c85dada8bf5b1ceb9ea361db38245f50..780e0e0eca3c22a8cfe95acc5e3184d13e6eb3b4 100644 (file)
@@ -2230,12 +2230,12 @@ Basic customization
       pair: built-in function; hash
 
    Called by built-in function :func:`hash` and for operations on members of
-   hashed collections including :class:`set`, :class:`frozenset`, and
-   :class:`dict`.  The ``__hash__()`` method should return an integer. The only required
-   property is that objects which compare equal have the same hash value; it is
-   advised to mix together the hash values of the components of the object that
-   also play a part in comparison of objects by packing them into a tuple and
-   hashing the tuple. Example::
+   hashed collections including :class:`set`, :class:`frozenset`, :class:`dict`,
+   and :class:`frozendict`. The ``__hash__()`` method should return an integer.
+   The only required property is that objects which compare equal have the same
+   hash value; it is advised to mix together the hash values of the components
+   of the object that also play a part in comparison of objects by packing them
+   into a tuple and hashing the tuple. Example::
 
        def __hash__(self):
            return hash((self.name, self.nick, self.color))