From 1688894fe0f4ff258278a25f53ee67295bd4f657 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Wed, 4 Dec 2019 14:06:12 +0100 Subject: [PATCH] Add regression test for overriding slots with property. Close #2439 --- .../r/regression_property_slots_2439.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/functional/r/regression_property_slots_2439.py diff --git a/tests/functional/r/regression_property_slots_2439.py b/tests/functional/r/regression_property_slots_2439.py new file mode 100644 index 0000000000..91cf86cfd9 --- /dev/null +++ b/tests/functional/r/regression_property_slots_2439.py @@ -0,0 +1,22 @@ +# pylint: disable=missing-docstring,invalid-name,too-few-public-methods +# https://github.com/PyCQA/pylint/issues/2439 +class TestClass: + __slots__ = ["_i"] + + def __init__(self): + self._i = 0 + + @property + def i(self): + return self._i + + @i.setter + def i(self, v): + self._i = v + + other = i + + +instance = TestClass() +instance.other = 42 +print(instance.i)