multiple-constructor-doc / W9005ΒΆ

Message emitted:

"%s" has constructor parameters documented in class and __init__

Description:

Please remove parameter declarations in the class or constructor.

Problematic code:

class Point:  # [multiple-constructor-doc]
    """Represents a point in the xy-coordinate plane.

    :param x: coordinate
    :param y: coordinate
    """

    def __init__(self, x, y):
        """Represents a point in the xy-coordinate plane.

        :param x: coordinate
        :param y: coordinate
        """
        self.x = x
        self.y = y

Correct code:

class Point:
    def __init__(self, x, y):
        """Represents a point in the xy-coordinate plane.

        :param x: x coordinate
        :param y: y coordinate
        """
        self.x = x
        self.y = y

Configuration file:

[main]
load-plugins=pylint.extensions.docparams

[Parameter_documentation]
no-docstring-rgx=^(?!__init__$)_

Additional details:

Both docstrings are acceptable but not both at the same time.

Note

This message is emitted by the optional 'parameter_documentation' checker, which requires the pylint.extensions.docparams plugin to be loaded.

Created by the parameter_documentation checker.