Good code is self-documenting code.
That’s why I’m getting into the habit of using Python Docstrings.
Here is a summary:
- First statement in module, function, class, or method (the “thing”) definition
- Becomes the __doc__ special attribute of the “thing” it’s documenting
- Don’t document the “thing’s” name or “signature”; you can get that with introspection.
- Do document the return value; you can’t get that with introspection.
- Triple double quotes (can be r (raw) or u (unicode))
- Prescription > description. Method’s effect, not only its result.