In this video course, you learned how to:
- Access a docstring at runtime using the
.__doc__attribute - Follow conventions for one-line and multiline docstrings described in PEP 257
- Format docstrings by using triple double quotes (
""") - Use common docstring formats like reStructuredText, Google-style, NumPy-style, and doctest-style
- Avoid docstring antipatterns like vague descriptions, inconsistent formatting, and missing return value explanations
With effective docstrings, you help readers and tools understand your code, prevent misunderstandings, and reduce the risk of bugs.
Resources mentioned in this lesson:
