Kaydet (Commit) 4cffe2f6 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) Eric V. Smith

bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean…

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 dbf9cff4)
Co-authored-by: 's avatarEric V. Smith <ericvsmith@users.noreply.github.com>
üst 1a579068
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