property-with-parameters / R0206ΒΆ

Message emitted:

Cannot have defined parameters for properties

Description:

Used when we detect that a property also has parameters, which are useless, given that properties cannot be called with additional arguments.

Problematic code:

class Worm:
    @property
    def bore(self, depth):  # [property-with-parameters]
        pass

Correct code:

class Worm:
    @property
    def bore(self):
        """Property accessed with '.bore'."""
        pass

    def bore_with_depth(depth):
        """Function called with .bore_with_depth(depth)."""
        pass

Created by the classes checker.