]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix presentation of dataclasses' `unsafe_hash` default value (#116532)
authorVictorien <65306057+Viicos@users.noreply.github.com>
Thu, 12 Jun 2025 01:30:33 +0000 (03:30 +0200)
committerGitHub <noreply@github.com>
Thu, 12 Jun 2025 01:30:33 +0000 (21:30 -0400)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/library/dataclasses.rst

index f18c7cc9c02da6b9e81030f1b29fcd87736b39c7..299c8aa399c25c048e4c474b82b70084a9a10c5f 100644 (file)
@@ -121,8 +121,11 @@ Module contents
      :meth:`!__le__`, :meth:`!__gt__`, or :meth:`!__ge__`, then
      :exc:`TypeError` is raised.
 
-   - *unsafe_hash*: If ``False`` (the default), a :meth:`~object.__hash__` method
-     is generated according to how *eq* and *frozen* are set.
+   - *unsafe_hash*: If true, force ``dataclasses`` to create a
+     :meth:`~object.__hash__` method, even though it may not be safe to do so.
+     Otherwise, generate a :meth:`~object.__hash__` method according to how
+     *eq* and *frozen* are set.
+     The default value is ``False``.
 
      :meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are
      added to hashed collections such as dictionaries and sets.  Having a