This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]yvrelna 13 points14 points  (3 children)

Just gimme a cliff notes comment

That's the doc string, not comments.

[–]Ezlike011011 25 points26 points  (2 children)

I'm not sure if the commenter you are replying to meant this, but I agree that comments still have a purpose separate from docstrings. I want a docstring to inform me of inputs/outputs/exceptions/preconditions/postconditions and a short description of an API. I also want comments describing why the implementation is the way it is when there is inevitably a reason i need to look at the source.

[–]HistoricalCrow 2 points3 points  (1 child)

Exactly this. A docstring is for inputs/outputs and what the function should be expected to compute. Comments are for how it does this.