Content-Length: 268837 | pFad | http://github.com/python/cpython/commit/#start-of-content

684A38EB Fix presentation of dataclasses' `unsafe_hash` default value (#116532) · python/cpython@71f5faf · GitHub
Skip to content

Commit 71f5faf

Browse files
ViicosAA-Turner
andauthored
Fix presentation of dataclasses' unsafe_hash default value (#116532)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 6214373 commit 71f5faf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Doc/library/dataclasses.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ Module contents
121121
:meth:`!__le__`, :meth:`!__gt__`, or :meth:`!__ge__`, then
122122
:exc:`TypeError` is raised.
123123

124-
- *unsafe_hash*: If ``False`` (the default), a :meth:`~object.__hash__` method
125-
is generated according to how *eq* and *frozen* are set.
124+
- *unsafe_hash*: If true, force ``dataclasses`` to create a
125+
:meth:`~object.__hash__` method, even though it may not be safe to do so.
126+
Otherwise, generate a :meth:`~object.__hash__` method according to how
127+
*eq* and *frozen* are set.
128+
The default value is ``False``.
126129

127130
:meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are
128131
added to hashed collections such as dictionaries and sets. Having a

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/commit/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy