]> granicus.if.org Git - python/commit
bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_has...
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Mon, 26 Feb 2018 02:30:17 +0000 (21:30 -0500)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2018 02:30:17 +0000 (21:30 -0500)
commitdbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38
treeb44951c74baf95d62b496746de64cb6434896d5d
parent9c17e3a1987004b8bcfbe423953aad84493a7984
bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_hash. (#5891)

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.
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]