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 cwg
Recipients congma, cwg, mark.dickinson, miss-islington, realead, rhettinger, serhiy.storchaka, tim.peters
Date 2021-11-24.10:38:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637750333.97.0.574727367034.issue43475@roundup.psfhosted.org>
In-reply-to
Content
Hello.  I would like to point out a possible problem that this change to CPython has introduced.

This change looks innocent, but it breaks the unwritten rule that the hash value of a number (or actually any built-in immutable type!) in Python depends only on its value.

Thus, before this change, it was possible to convert a tuple of floats into a numpy array and back into a tuple, and the hash values of both tuples would be equal.  This is no longer the case.

Or, more generally, any hashable tuple could be pickled and unpickled, without changing its hash value.  I could well imagine that this breaks real code in subtle ways.

Likewise, it is now no longer possible to provide a library of sequences of numbers that always hashes like built-in tuples.  (As "tinyarray", of which I am the author, did.)
History
Date User Action Args
2021-11-24 10:38:54cwgsetrecipients: + cwg, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, miss-islington, realead, congma
2021-11-24 10:38:53cwgsetmessageid: <1637750333.97.0.574727367034.issue43475@roundup.psfhosted.org>
2021-11-24 10:38:53cwglinkissue43475 messages
2021-11-24 10:38:53cwgcreate