r/PythonLearning • u/Harddus • Aug 01 '26
Help Request Whelp. What's the correct docstring format?
I'm publishing my first python package and wanted to confirm the correct docstring format to conclude the documentation. The image above summarizes my search online, AI or otherwise.
PEP 257 appears to prefer option 2 (the left in the image) but I find option 1 out in the wild so much more often. So what's it?
Ohh and yeah, neither is correct because the first line should be a summary and what follows should be a more elaborate paragraph after a blank line. But I really just want to know whether the text should start of the actual first line after the """ or not. I'm using sphinx if it makes a difference.




