Docstrings for documentation about functions, methods , class and modules in Python using formats

preview_player
Показать описание
While developing functions or modules we can include documentations saying about the uses and inputs required including the special notes if any.

This documentation about the script has to be included just after the declaration of the function / module / method.
It can be included in one line or in multiple lines by enclosing within three single or double quotes.

We can read the docstrings by using __doc__

We should include about the functions, arguments, return value, error if any and additional notes in our Docstrings.

We can read the docstrings of popular libraries like Pandas , Numpy , Tkinter
import pandas as pd
print(pd.__doc__)

Full details and source code can be downloaded from here

#docstrings #Documentation #functionDetails #help #PythonModuleDetails #__doc__ #plus2net
Рекомендации по теме