Commit dbf9cff4 authored by Eric V. Smith's avatar Eric V. Smith Committed by GitHub

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.
parent 9c17e3a1
This diff is collapsed.
This diff is collapsed.
Remove the tri-state parameter "hash", and add the boolean "unsafe_hash". If
unsafe_hash is True, add a __hash__ function, but if a __hash__ exists,
raise TypeError. If unsafe_hash is False, add a __hash__ based on the
values of eq= and frozen=. The unsafe_hash=False behavior is the same as
the old hash=None behavior. unsafe_hash=False is the default, just as
hash=None used to be.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment