Index: Doc/library/functions.rst =================================================================== --- Doc/library/functions.rst (revision 62996) +++ Doc/library/functions.rst (working copy) @@ -896,12 +896,32 @@ turns the :meth:`voltage` method into a "getter" for a read-only attribute with the same name. + The ``getter``, ``setter``, and ``deleter`` attributes of the returned + property object can also be used as decorators to mark the special + methods. The following is equivalent to the first example. :: + + class C(object): + def __init__(self): self._x = None + @property + def x(self): return self._x + @x.setter + def setx(self, value): self._x = value + @x.deleter + def delx(self): del self._x + + + The returned property also has the attributes ``fget``, ``fset``, and + ``fdel`` corresponding to the constructor arguments. + .. versionadded:: 2.2 .. versionchanged:: 2.5 Use *fget*'s docstring if no *doc* given. + .. versionchanged:: 2.6 + The ``getter``, ``setter``, and ``deleter`` attributes were added. + .. function:: range([start,] stop[, step]) This is a versatile function to create lists containing arithmetic progressions.