What are the most common Python docstring formats?

Formats Python docstrings can be written following several formats as the other posts showed. However the default Sphinx docstring format was not mentioned and is based on reStructuredText (reST). You can get some information about the main formats in this blog post. Note that the reST is recommended by the PEP 287 There follows the main used formats … Read more

Is there a way to create multiline comments in Python?

You can use triple-quoted strings. When they’re not a docstring (the first thing in a class/function/module), they are ignored. (Make sure to indent the leading ”’ appropriately to avoid an IndentationError.) Guido van Rossum (creator of Python) tweeted this as a “pro tip”. However, Python’s style guide, PEP8, favors using consecutive single-line comments, like this: …and this is also what you’ll find … Read more