Posted in software

DocString guidelines from Python

This PEP talks about how to use/frame docstrings for consistency with the rest of the community. Some noteworthy points are:

  • docstring should be in command language – do this, return that – rather than descriptive – does this, returns that
  • Use triple double quotes even for single line docstring
  • Multiline docstrings have summary in the first line, a blank line and then an elaborate explanation of the object in hand

More such conventions mentioned, worth noting…

Leave a comment