Skip to content

Documentation

Sylvain Bellemare edited this page Oct 26, 2016 · 1 revision

Documenting Python Code

Random Notes

If a class has no doctring, e.g.:

class Transaction:
    def validate(self, bigchain):
        """Validate a transaction."""

Then, the class will not get pulled automatically by Sphinx with the following snippet:

.. automodule:: bigchaindb.models
    :members:

A simple empty docstring would work:

class Transaction:
    """ """
    def validate(self, bigchain):
        """Validate a transaction."""

Conclusion: It may be a good idea to always document a class, if we wish to be able to quickly pull the docstings of its members.

Clone this wiki locally