Top "Docstring" questions

A docstring is a string that occurs as the first statement in a module, function, class, or method definition, and is used to document the object in which it occurs.

Python decorator handling docstrings

I have a problem using docstrings with decorators. Given the following example: def decorator(f): def _decorator(): print 'decorator active' …

python decorator docstring
Multi-line description of a parameter description in python docstring

So, reStructuredText is the recommended way for Python code documentation, if you try hard enough, you can find in the …

python coding-style python-sphinx restructuredtext docstring
Multiline Clojure docstrings

I've noticed that Clojure multiline docstrings seem to be manually formatted in most cases, including the ones in clojure.core. …

clojure documentation docstring
Adding docstrings to namedtuples?

Is it possible to add a documentation string to a namedtuple in an easy manner? I tried from collections import …

python docstring namedtuple
How do I document :rtype: for a function that returns multiple possible data types?

In a Python docstring how should one document the :rtype: for a function that can return multiple possible data types? …

python return-type restructuredtext docstring
Docstrings when nothing is returned

What is the docstring convention when a function doesn't return anything? For example: def f(x): """Prints the element given …

python function return docstring
In Django RestFramework, how to change the Api Root documentation?

In django RestFramework, is there any "official" way to generate the documentation for the "Api Root" ? After looking at the …

django django-rest-framework docstring
function name + tab does not return docstring in IPython

In IPython, I am used to write function( and then strike a tab, and get the contents of the docstring …

ipython ipython-notebook jupyter-notebook docstring tab-completion
Are there any real alternatives to reStructuredText for Python documentation?

I'm starting an open source Python project shortly and I'm trying to decide in advance how to write my docstrings. …

python python-sphinx restructuredtext docstring
Python docstrings to GitHub README.md

How do I transcode Python documentation strings to a GitHub readme.md file? Even though it seems like something everyone …

python markdown restructuredtext docstring manpage