[New-bugs-announce] [issue45605] Return False from __contains__ method if object not hashable for set and dict

Андрей Казанцев report at bugs.python.org
Mon Oct 25 11:22:39 EDT 2021


New submission from Андрей Казанцев <heckad at yandex.ru>:

Now if do something like `[] in set()` python raise an exception, but if an object isn't hashable then we know for sure that it isn't in the set. Propose return False for these cases.

P.S. I would like to make a patch

----------
components: Library (Lib)
messages: 404971
nosy: heckad
priority: normal
severity: normal
status: open
title: Return False from __contains__ method if object not hashable for set and dict
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45605>
_______________________________________


More information about the New-bugs-announce mailing list