[issue24434] ItemsView.__contains__ does not mimic dict_items

Serhiy Storchaka report at bugs.python.org
Sat Dec 19 16:41:12 EST 2015


Serhiy Storchaka added the comment:

Yet one corner case:

>>> (1, math.nan) in {1: math.nan}.items()
True
>>> (1, math.nan) in ItemsView({1: math.nan})
False

This can be resolved if compare not v with value, but a tuple (key, v) with item.

----------

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


More information about the Python-bugs-list mailing list