PEP 8: docstring question

Does this mean that each of my functions must have a docstring, even if it is a single line or the only one in the file? Or if this function is the only one written exclusively for the programming competitions?

No.

  1. PEP 8 is only guidelines, not rules. Use your judgement.
  2. PEP 8 is technically only the style guide for code writtent for the standard library. It’s your choice whether you follow it in your own code.
4 Likes

Thank you for your assistance!

Though some tools (black comes to mind, others in their default configuration) treat PEP-8 as if it was engraved on tablets handed down from on high. YMMV…

I don’t think black is even compliant with pep 8?

That could be. I used it once, then uninstalled it.

2 Likes