]> granicus.if.org Git - python/commitdiff
Fixed incorrect default value for dataclass unsafe_hash. (GH-5949) (GH-5950)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 1 Mar 2018 13:30:13 +0000 (05:30 -0800)
committerEric V. Smith <ericvsmith@users.noreply.github.com>
Thu, 1 Mar 2018 13:30:13 +0000 (08:30 -0500)
(cherry picked from commit 5da8cfb838fa1bf3529c085c6dce1adf3d1eaf62)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Lib/dataclasses.py

index 54478fec93df8f82b312f37250efd8abcd1609ba..b55a497db302e2f5b37ce7e39fe7e11d994e09e6 100644 (file)
@@ -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.