]> granicus.if.org Git - python/commit
bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_has...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 26 Feb 2018 09:43:35 +0000 (01:43 -0800)
committerEric V. Smith <ericvsmith@users.noreply.github.com>
Mon, 26 Feb 2018 09:43:35 +0000 (04:43 -0500)
commit4cffe2f66b581fa7538f6de884d54a5c7364d8e0
tree91054ec09246654d2fd5b9edbce10585a4bd16e4
parent1a5790689f134881d8e7cc8b1ac45121468823c6
bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_hash. (GH-5891) (GH-5902)

unsafe_hash=False is now the default. It is the same behavior as the old hash=None parameter. unsafe_hash=True will try to add __hash__. If it already exists, TypeError is raised.
(cherry picked from commit dbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Lib/dataclasses.py
Lib/test/test_dataclasses.py
Misc/NEWS.d/next/Library/2018-02-25-13-47-48.bpo-32929.X2gTDH.rst [new file with mode: 0644]