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 <>
> 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.


class K:
    def __eq__(self, other):
        return True
    def __hash__(self):
        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.
Date User Action Args
2019-07-04 11:55:14methanesetrecipients: + methane, rhettinger, vstinner, larry, python-dev, jdemeyer
2019-07-04 11:55:14methanesetmessageid: <>
2019-07-04 11:55:14methanelinkissue29312 messages
2019-07-04 11:55:13methanecreate