Skip to content

Tag: comments

Proper use of comments

For Python code, PEP 257 provides a convention for using docstrings to document structural entities: packages, modules, functions, classes, and methods. This covers pretty much everything. Stack Overflow questions about how to comment Python code invariably elicit answers saying to use docstrings. Where does …

How do I create multiline comments in Python?

How do I make multi-line comments? Most languages have block comment symbols like: Answer 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 IndentationE…