About 50 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. 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, …

  3. 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 …

  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. docstring - How to document fields and properties in Python? - Stack ...

    For module data members and class attributes, documentation can either be put into a comment with special formatting (using a #: to start the comment instead of just #), or in a docstring after the …

  6. 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:

  7. 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 …

  8. 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...

  9. 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 …

  10. python - Where can I find proper examples of the PEP 257 Docstring ...

    Feb 29, 2016 · Specifically I'm lokking for an example of docstrings for a class that matches the PEP. halst's code shows blank lines before and after the class docstring as well as an empty line at the …