On Fri, Dec 24, 2021 at 12:14 AM Hao Hu <hao.hu...@gmail.com> wrote: > - generalize the signature of __hash__(object) to __hash__(object, > *args, **kwargs). In the default implementation, we discard the keyword > "salt" and use the default fallback salt if the keyword is not present, > otherwise we use the salt specified by the keyword. >
That means that EVERY __hash__ implementation that calls hash() MUST pass along all spare arguments. This is a breaking change that will affect a lot of third-party code. Changing a dunder's signature is a very big deal and needs a lot more justification than this. How important *is* it to be able to lock in the seed/salt (they're not the same thing) when hashing arbitrary objects? ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/XAZIFH4GHWIREGIGU5KHGZJJM3Y6NDJZ/ Code of Conduct: http://python.org/psf/codeofconduct/