August 2019
Beginner
482 pages
12h 56m
English
As with naming, docstrings might seem to be a minor issue – but they are not. Always add a docstring to your code; it will double your productivity! Also, it will help you to keep good relationships with your colleagues and clients.
As we mentioned before, docstrings are short explanation texts bound to specific module (.py file), function, or class. All you need is to write it as a string at the beginning of the corresponding scope – beginning of the file, function, or class. At the execution time, those strings are stored as a __docs__ variable. What's even more important is the fact that all coding environments, including VS Code and Jupyter, understand docstrings and how to handle them.
As we mentioned previously, in Jupyter, ...