summaryrefslogtreecommitdiffstats
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2013-06-07 20:54:03 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2013-06-07 20:54:03 (GMT)
commitfdcf2b7d4e61a484bfae60222c7eec3ab2d9c009 (patch)
treec2f75fa31a8c1c1848d0d4952a722ccccdf2bebf /Doc/glossary.rst
parent7f7a67aac8667539abef73cec6ad763b9b0f97b8 (diff)
downloadcpython-fdcf2b7d4e61a484bfae60222c7eec3ab2d9c009.zip
cpython-fdcf2b7d4e61a484bfae60222c7eec3ab2d9c009.tar.gz
cpython-fdcf2b7d4e61a484bfae60222c7eec3ab2d9c009.tar.bz2
moved the single-dispatch generic function definitions to the glossary
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 63f1021..0d3a5f5 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -302,6 +302,15 @@ Glossary
>>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81
285
+ generic function
+ A function composed of multiple functions implementing the same operation
+ for different types. Which implementation should be used during a call is
+ determined by the dispatch algorithm.
+
+ See also the :term:`single dispatch` glossary entry, the
+ :func:`functools.singledispatch` decorator, and :pep:`443`.
+
+
GIL
See :term:`global interpreter lock`.
@@ -745,6 +754,10 @@ Glossary
mapping rather than a sequence because the lookups use arbitrary
:term:`immutable` keys rather than integers.
+ single dispatch
+ A form of :term:`generic function` dispatch where the implementation is
+ chosen based on the type of a single argument.
+
slice
An object usually containing a portion of a :term:`sequence`. A slice is
created using the subscript notation, ``[]`` with colons between numbers