mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
Fixed incorrect default value for dataclass unsafe_hash. (GH-5949) (GH-5950)
(cherry picked from commit 5da8cfb838
)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
This commit is contained in:
parent
6ae75d9d12
commit
398242a5b6
1 changed files with 2 additions and 2 deletions
|
@ -745,7 +745,7 @@ def _process_class(cls, repr, eq, order, unsafe_hash, init, frozen):
|
|||
# underscore. The presence of _cls is used to detect if this
|
||||
# decorator is being called with parameters or not.
|
||||
def dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False,
|
||||
unsafe_hash=None, frozen=False):
|
||||
unsafe_hash=False, frozen=False):
|
||||
"""Returns the same class as was passed in, with dunder methods
|
||||
added based on the fields defined in the class.
|
||||
|
||||
|
@ -880,7 +880,7 @@ def _astuple_inner(obj, tuple_factory):
|
|||
|
||||
|
||||
def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,
|
||||
repr=True, eq=True, order=False, unsafe_hash=None,
|
||||
repr=True, eq=True, order=False, unsafe_hash=False,
|
||||
frozen=False):
|
||||
"""Return a new dynamically created dataclass.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue