Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive property-with-parameters for an @abstractproperty setter #3600

Closed
volans- opened this issue May 6, 2020 · 0 comments
Closed

Comments

@volans-
Copy link

volans- commented May 6, 2020

Steps to reproduce

  1. Define the following code with an abstract setter:
"""MyModule."""
from abc import ABC, abstractproperty


class MyClassBase(ABC):
    """MyClassBase."""

    @abstractproperty
    def example(self):
        """Getter."""

    @abstractproperty
    @example.setter
    def example(self, value):
        """Setter."""
  1. Run pylint on the file

Current behavior

The following problem is reported for the abstract setter:

example.py:14:4: R0206: Cannot have defined parameters for properties (property-with-parameters)

Removing the @abstractproperty on line 12 makes the property-with-parameters problem disappear.

Expected behavior

It should not report any problem for the definition of the abstract setter as it's correct that it has a parameter to set the value.

pylint --version output

$ pylint --version
pylint 2.5.2
astroid 2.4.1
Python 3.7.7 (default, Mar 10 2020, 15:43:03)
[Clang 11.0.0 (clang-1100.0.33.17)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants