Suggestion: adopt a documentation format for docstring
Author: dhruvmanilaCreated Jul 14, 2022Updated Sep 12, 2026
Labelsawaiting reviews
As the number of algorithms are increasing, it might make sense to adopt a single documentation format for docstrings. Following are existing currently:
- Google Docstring: https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings
- Numpydoc: https://numpydoc.readthedocs.io/en/latest/format.html
- Sphinx: https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html
There are editor extensions which help in generating the docstring based on the chosen format like:
The doctest will come under the examples section for each of the above format.
Source: TheAlgorithms/Python