Caleb Levy added the comment:
Sorry; that should be DictLikeMapping(a="b").items(), where DictLikeMapping is
defined in the patch unit tests.
--
___
Python tracker
<http://bugs.python.o
Caleb Levy added the comment:
@serhiy.storchaka: I don't think that will work.
First of all,
x, y = item
will raise a ValueError if fed an iterable whose length is not exactly 2, so
you would have to check for that. Moreover, if item is something like a dict,
for example, then:
New submission from Caleb Levy:
The current implementation ItemsView.__contains__ reads
class ItemsView(MappingView, Set):
...
def __contains__(self, item):
key, value = item
try:
v = self._mapping[key]
except KeyError:
return False
Changes by Caleb Levy :
--
components: Library (Lib)
nosy: clevy, rhettinger, stutzbach
priority: normal
severity: normal
status: open
title: ItemsView.__contains__ does not mimic dict_items
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6