Jump to content

Docstring

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wlievens (talk | contribs) at 11:23, 28 February 2006 (initial page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In programming, a docstring is a comment included in source code to document the purpose of a piece of code. Unlike conventional source code comments, or even specifically formatted comments like Javadoc documentation, docstrings are not stripped from the source tree when it is parsed, but are retained throughout the runtime of the program. This allows the program to inspect these comments at run time, for instance as an interactive help system, or as metadata

Among languages that support docstrings are Python and Lisp.