https://github.com/python/cpython/commit/16a06be016de4e4c855941b94a44c1d7abdac824
commit: 16a06be016de4e4c855941b94a44c1d7abdac824
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2025-02-20T07:53:58Z
summary:

[3.12] gh-130130: Clarify `hash=False` docs in `dataclasses.field` (GH-130324) 
(#130336)

gh-130130: Clarify `hash=False` docs in `dataclasses.field` (GH-130324)
(cherry picked from commit 47ace539950fb675d5968736348f0d724ba199f0)

Co-authored-by: Sabfo <[email protected]>

files:
M Doc/library/dataclasses.rst

diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index 87b532fb4f8357..3151232588f53b 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -277,10 +277,11 @@ Module contents
      string returned by the generated :meth:`~object.__repr__` method.
 
    - *hash*: This can be a bool or ``None``.  If true, this field is
-     included in the generated :meth:`~object.__hash__` method.  If ``None`` 
(the
-     default), use the value of *compare*: this would normally be
-     the expected behavior.  A field should be considered in the hash
-     if it's used for comparisons.  Setting this value to anything
+     included in the generated :meth:`~object.__hash__` method.  If false,
+     this field is excluded from the generated :meth:`~object.__hash__`.
+     If ``None`` (the default), use the value of *compare*: this would
+     normally be the expected behavior, since a field should be included
+     in the hash if it's used for comparisons.  Setting this value to anything
      other than ``None`` is discouraged.
 
      One possible reason to set ``hash=False`` but ``compare=True``

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to