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 rhettinger
Recipients docs@python, gsnedders, rhettinger
Date 2019-06-04.08:39:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559637599.29.0.153939588139.issue37145@roundup.psfhosted.org>
In-reply-to
Content
The __init__ method is public.  Here is how to use ItemsView:

>>> from collections.abc import ItemsView
>>> d = dict(python='snake', ruby='gem', go='board game', c='speed of light')
>>> iv = ItemsView(d)
>>> ('python', 'snake') in iv
True
>>> list(iv)
[('python', 'snake'), ('ruby', 'gem'), ('go', 'board game'), ('c', 'speed of light')]
>>> len(iv)
4
>>> d['python'] = 'language'
>>> list(iv)
[('python', 'language'), ('ruby', 'gem'), ('go', 'board game'), ('c', 'speed of light')]

Note, there is no direct access to _mapping.
History
Date User Action Args
2019-06-04 08:39:59rhettingersetrecipients: + rhettinger, docs@python, gsnedders
2019-06-04 08:39:59rhettingersetmessageid: <1559637599.29.0.153939588139.issue37145@roundup.psfhosted.org>
2019-06-04 08:39:59rhettingerlinkissue37145 messages
2019-06-04 08:39:59rhettingercreate