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

PLE0237 unaware of properties with setter #11358

Closed
mal opened this issue May 10, 2024 · 1 comment · Fixed by #11377
Closed

PLE0237 unaware of properties with setter #11358

mal opened this issue May 10, 2024 · 1 comment · Fixed by #11377
Labels
bug Something isn't working

Comments

@mal
Copy link

mal commented May 10, 2024

Keywords: PLE0237, setter, property

class Foo:
    __slots__ = ('bar',)

    def __init__(self):
        self.qux = 2

    @property
    def qux(self):
        return self.bar * 2

    @qux.setter
    def qux(self, value):
        self.bar = value / 2
$ ruff --version
ruff 0.4.4
$ ruff check --isolated --extend-select PLE0237 .
foo.py:5:9: PLE0237 Attribute `qux` is not defined in class's `__slots__`
Found 1 error.
@charliermarsh charliermarsh added the bug Something isn't working label May 10, 2024
@charliermarsh
Copy link
Member

Thanks, looks like a bug.

charliermarsh pushed a commit that referenced this issue May 13, 2024
## Summary

Should this consider the decorator only if the name is actually a
property or is the logic in this PR correct?

fixes: #11358

## Test Plan

Add test case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants