diff options
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 778fd40..847500e 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -309,6 +309,12 @@ Glossary keys can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a hash in Perl. + dictionary comprehension + A compact way to process all or part of the elements in an iterable and + return a dictionary with the results. ``results = {n: n ** 2 for n in + range(10)}`` generates a dictionary containing key ``n`` mapped to + value ``n ** 2``. See :ref:`comprehensions`. + dictionary view The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:`dict.items` are called dictionary views. They provide a dynamic @@ -1027,6 +1033,12 @@ Glossary interface can be registered explicitly using :func:`~abc.ABCMeta.register`. + set comprehension + A compact way to process all or part of the elements in an iterable and + return a set with the results. ``results = {c for c in 'abracadabra' if + c not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See + :ref:`comprehensions`. + single dispatch A form of :term:`generic function` dispatch where the implementation is chosen based on the type of a single argument. |