Ben Chuanlong Du's Blog

It is never too late to learn.

Docstring in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. I personal prefer the sphnix style as it is concise and work well with type annotation.

  2. Improperly escaped \n in docstring causes darglint fail to parse the docstring.

VSCode Docstring Sphinx

References

What is the standard Python docstring format? [closed]

Documenting Python Code: A Complete Guide

The docstrings main formats

Documenting Python

Docstrings in Python

Comments