Jump to content

Docstring

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Eurleif (talk | contribs) at 09:35, 12 November 2006 (Fixed list markup.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.

Tools using docstrings