3 ms·
Technically multiline strings in Python are the recommended style for multiline comments (e.g. docstrings).
by skykooler 4y ago
Technically multiline strings in Python are the recommended style for multiline comments (e.g. docstrings).
- deleted 4y ago[deleted]
- Kwpolska 4y agoThey are recommended for docstrings, but not for comments in general. The compiler has a special case if the first statement of a function/class/module is a string (doesn’t have to be multiline), and it puts that string in the __doc__ attribute of that function/class/module — those are docstrings, and they need to be something visible to the compiler.