This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients jdemeyer, larry, methane, python-dev, rhettinger, vstinner
Date 2019-07-04.11:55:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562241314.1.0.196779745378.issue29312@roundup.psfhosted.org>
In-reply-to
Content
> The unpacking is only a problem if you insist on using PyDict_Merge(). It would be perfectly possible to implement dict merging from a tuple+vector instead of from a dict. In that case, there shouldn't be a performance penalty.

Really?

```
class K:
    def __eq__(self, other):
        return True
    def __hash__(self):
        time.sleep(10)
        return 42

d1 = {"foo": 1, "bar": 2, "baz": 3, K(): 4}
d2 = dict(**d1)
```

I think `dict(**d1)` doesn't call K.__hash__() in this example, because hash value is cached in d1.
History
Date User Action Args
2019-07-04 11:55:14methanesetrecipients: + methane, rhettinger, vstinner, larry, python-dev, jdemeyer
2019-07-04 11:55:14methanesetmessageid: <1562241314.1.0.196779745378.issue29312@roundup.psfhosted.org>
2019-07-04 11:55:14methanelinkissue29312 messages
2019-07-04 11:55:13methanecreate