Kent Wong
Kent Wong

Reputation: 581

What is PEP8 convention to docstring a Class that inherits another class?

When I try to follow PEP8 and doc string a class that involves inheritance, PyCharm/PyCode Check for PEP8 always gives me a warning that the inherited parameters have no reference. Is it better to just delete these? Should I mention the params at all in the class that subclasses?

For example

MODULE 1

class Parent:
    """Parent class
    :param plugin: a plugin
    :type plugin: plugin type

    """

    def __init___(self,plugin):
         self.plugin = plugin

MODULE 2

class Child(Parent):
    """
    :param plugin: the plugin from parent class
    """

Module 2 will give me a warning about plugin having no reference. Best practice for PEP8?

Upvotes: 1

Views: 3607

Answers (1)

Kent Wong
Kent Wong

Reputation: 581

No canonical PEP8 answer for this, so closing. Standard practice is to not include or mention the doc string of parent in the child.

Upvotes: 2

Related Questions