[docs] [issue23987] docs about containers membership testing wrong for broken objects

Ethan Furman report at bugs.python.org
Mon Apr 20 17:29:23 CEST 2015


Ethan Furman added the comment:

So something like:

For container types such as list, tuple, or collections.deque, the expression 'x in y' is equivalent to 'any(x is e or x == e for e in y)'.  For container types such as set, frozenset, and dict, this equivalence expression is modified by the addition of 'if hash(x) == hash(e)'.

?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23987>
_______________________________________


More information about the docs mailing list