Skip to main content Brad's PyNotes

Posts on Docstrings

  1. PEP 257: Docstring Conventions for Self-Documenting Code

    TL;DR

    PEP 257 defines standardized conventions for Python docstrings, covering how to document modules, functions, classes, and methods using string literals that become the __doc__ attribute. The conventions emphasize triple double quotes, command-style phrasing, and consistent formatting.