Skip to content

PLE0237 unaware of properties with setter #11358

@mal

Description

@mal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions