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 eric.smith
Recipients CCLDArjun, eric.smith, gianni, rhettinger
Date 2021-10-03.19:16:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633288617.33.0.706256082958.issue44674@roundup.psfhosted.org>
In-reply-to
Content
That's a good idea, Raymond.

>>> [x.__hash__ is None for x in (list, dict, set, frozenset)]
[True, True, True, False]

I don't think this change would cause any backward compatibility issues, except it would now allow a default of something bad like:

>>> class BadList(list):
...   def __hash__(self): return 0
...
>>> isinstance(BadList(), list), BadList.__hash__ is None
(True, False)

I can't say I care too much about now allowing things that didn't used to be allowed, especially if they're poorly designed like BadList.

I'll put together a PR.
History
Date User Action Args
2021-10-03 19:16:57eric.smithsetrecipients: + eric.smith, rhettinger, CCLDArjun, gianni
2021-10-03 19:16:57eric.smithsetmessageid: <1633288617.33.0.706256082958.issue44674@roundup.psfhosted.org>
2021-10-03 19:16:57eric.smithlinkissue44674 messages
2021-10-03 19:16:57eric.smithcreate