This allows the programmer to inspect these comments at run time, for instance as an interactive help system, or as metadata.
Languages that support docstrings include Python, Lisp, Elixir, Clojure,[1] Gherkin,[2] Julia[3] and Haskell.
The Common Lisp standard states that a particular implementation may choose to discard docstrings whenever they want, for whatever reason.
[5] For instance: The common practice of documenting a code object at the head of its definition is captured by the addition of docstring syntax in the Python language.
The following Python file shows the declaration of docstrings within a Python source file: Assuming that the above code was saved as mymodule.py, the following is an interactive session showing how the docstrings may be accessed: