diff options
author | Georg Brandl <georg@python.org> | 2008-07-20 11:50:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-07-20 11:50:29 (GMT) |
commit | e64f7385073028f4e916c4eb12342ecb91c50884 (patch) | |
tree | 3184235d2da7e900c934a98d7d432191004adfca /Doc/glossary.rst | |
parent | 61d5c43011a672a29ce77962c12284f676342fee (diff) | |
download | cpython-e64f7385073028f4e916c4eb12342ecb91c50884.zip cpython-e64f7385073028f4e916c4eb12342ecb91c50884.tar.gz cpython-e64f7385073028f4e916c4eb12342ecb91c50884.tar.bz2 |
#926501: add info where to put the docstring.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index fc55d1f..81e29f1 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 |