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…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s