On May 27, 3:24 pm, Christian Heimes <li...@cheimes.de> wrote: > > Do I miss something? > > Is this the way to do it, or is there a better one? > > A better way was introduced in Python 2.6. > Seehttp://docs.python.org/library/functions.html?highlight=property#prop... > I have a Python only version around if you are still using Python 2.5. > > Christian
Mmmm, I might still miss something. OK, I can replace my initial property using @property and @p.setter, but it doesn't seem to work in subclasses: class A(object): @property def p(self): return self._p @p.setter def _set_p(self, p): self._p = p class B(A): @p.setter def _set_p(self, p): … results in: Traceback (most recent call last): File "toto.py", line 8, in <module> class B(A): File "toto.py", line 9, in B @p.setter NameError: name 'p' is not defined -- http://mail.python.org/mailman/listinfo/python-list