summaryrefslogtreecommitdiff
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-20 11:50:29 +0000
committerGeorg Brandl <georg@python.org>2008-07-20 11:50:29 +0000
commitdd69f0d0926982f6ea8073312248bbea02149aee (patch)
treee87444b2090407d456014e3f0fa3dbb83aff3850 /Doc/glossary.rst
parent5cced668958f0ccf105e6b5efdb7ff71e42f0e97 (diff)
downloadcpython-dd69f0d0926982f6ea8073312248bbea02149aee.tar.gz
#926501: add info where to put the docstring.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index fc55d1fc3c..81e29f1846 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -123,6 +123,14 @@ Glossary
of :class:`dict` much resembles that for :class:`list`, but the keys can
be any object with a :meth:`__hash__` function, not just integers starting
from zero. Called a hash in Perl.
+
+ docstring
+ A docstring ("documentation string") is a string literal that appears as
+ the first thing in a class or function suite. While ignored when the
+ suite is executed, it is recognized by the compiler and put into the
+ :attr:`__doc__` attribute of the class or function. Since it is available
+ via introspection, it is the canonical place for documentation of the
+ object.
duck-typing
Pythonic programming style that determines an object's type by inspection