Skip to content

Property setter not accepted if not next to getter #1465

Open
@mihneagiurgea

Description

@mihneagiurgea

The following code incorrectly raises an error:

class Config(object):

    @property
    def my_proprty(self):
        return None

    def _other(self):
        pass

    @my_proprty.setter
    def my_proprty(self, val):
        pass

Error:

mypytest.py: note: In class "Config":
mypytest.py:12: error: Callable[[Any], Any] has no attribute "setter"

Commenting out the _other method will fix the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions