I document my Python code using Sphinx and read in the Python developer guide (and, I think, elsewhere) that reST files use an indent of 3 spaces:
All relay files use an indent of 3 spaces; no tabs are allowed.
This is an example for an example that I copied for my index file, and some other files in which my IDE took a 3-space indent and used it for the whole page. The extension sphinx-apidoc
also uses 3 spaces for the file modules.rst
that it creates.
On the other hand, since Python uses 4-space indentation, all of my docstrings are indented with 4 spaces. Moreover, directives .. automodule::
generated sphinx-apidox
have 4 spaces.
The fact is that it all works! Therefore, it remains for me to wonder if the requirement of a print in 3 spaces is a mandatory requirement, or if it is good practice, but only in terms of style? (And if so, why when all Python things have 4-space indentation?)
Or are there cases where there is no 3-spatial indentation that will break my assembly?
Other places I was looking for
, Python , , , "3--4- " Sphinx Python.