Skip to content

Commit 85b8f45

Browse files
committed
Issue #25286: Dictionary views are not sequences
Also change glossary heading from view
1 parent bd6c41a commit 85b8f45

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Doc/glossary.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ Glossary
183183
keys can be any object with :meth:`__hash__` and :meth:`__eq__` methods.
184184
Called a hash in Perl.
185185

186+
dictionary view
187+
The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and
188+
:meth:`dict.items` are called dictionary views. They provide a dynamic
189+
view on the dictionary’s entries, which means that when the dictionary
190+
changes, the view reflects these changes. To force the
191+
dictionary view to become a full list use ``list(dictview)``. See
192+
:ref:`dict-views`.
193+
186194
docstring
187195
A string literal which appears as the first expression in a class,
188196
function or module. While ignored when the suite is executed, it is
@@ -853,13 +861,6 @@ Glossary
853861
``'\r'``. See :pep:`278` and :pep:`3116`, as well as
854862
:func:`bytes.splitlines` for an additional use.
855863

856-
view
857-
The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and
858-
:meth:`dict.items` are called dictionary views. They are lazy sequences
859-
that will see changes in the underlying dictionary. To force the
860-
dictionary view to become a full list use ``list(dictview)``. See
861-
:ref:`dict-views`.
862-
863864
virtual environment
864865
A cooperatively isolated runtime environment that allows Python users
865866
and applications to install and upgrade Python distribution packages

Doc/library/collections.abc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ ABC Inherits from Abstract Methods Mixin
122122
KeysView
123123
ValuesView
124124

125-
ABCs for mapping, items, keys, and values :term:`views <view>`.
125+
ABCs for mapping, items, keys, and values :term:`views <dictionary view>`.
126126

127127

128128
These ABCs allow us to ask classes or instances if they provide

0 commit comments

Comments
 (0)