About 244,000 results
Open links in new tab
  1. How to document class attributes in Python? - Stack Overflow

    Also note that my example will cause the documentation for the attributes to appear in the class's docstring. I actually would prefer to put the documentation in docstrings of the attributes themselves, …

  2. python - Should I list class methods in the class docstring? - Stack ...

    Jun 18, 2020 · The class docstring needs to just describe the class and the docstring of individual methods then handle describing themselves. Also the wording in the PEP to me means that the class …

  3. docstring in class or __init__ constructor? - Stack Overflow

    The docstring for a class should summarize its behavior and list the public methods and instance variables. If the class is intended to be subclassed, and has an additional interface for subclasses, …

  4. python - Is there a consensus on what should be documented in the …

    May 4, 2016 · The docstring for a class should summarize its behavior and list the public methods and instance variables. If the class is intended to be subclassed, and has an additional interface for …

  5. Python DocString (Google Style): How to document class attributes?

    Jul 21, 2020 · Assuming you would like to use napoleon to render your docstrings into docs, the sphinx developers are working towards a way to add custom sections to class-level docstrings (see Issue …

  6. Inherit docstrings in Python class inheritance - Stack Overflow

    Dec 23, 2022 · I'm trying to do some class inheritance in Python. I'd like each class and inherited class to have good docstrings. So I think for the inherited class, I'd like it to: inherit the base class docstr...

  7. What are the most common Python docstring formats?

    The Google style guide contains an excellent Python style guide. It includes conventions for readable docstring syntax that offers better guidance than PEP-257. For example:

  8. oop - Inheriting methods' docstrings in Python - Stack Overflow

    Mar 30, 2017 · It can inherit the docstring from any class in any of the base classes's MROs, just like regular attribute inheritance. Unlike with a class decorator, the metaclass is inherited, so you only …

  9. docstring - How to document fields and properties in Python? - Stack ...

    5 Document freely accessible attributes in the class docstring or make them into properties. You're documenting properties properly, the problem might be in 2.x and old-style classes, which don't …

  10. How do I document a constructor for a class using Python dataclasses?

    Jul 2, 2018 · It seems dataclasses automatically generate a docstring for the class that include the type hints from the class definition, for example 'C(name: str, number: int)', but the docstring for the …