summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-02 21:45:43 (GMT)
committerGeorg Brandl <georg@python.org>2010-08-02 21:45:43 (GMT)
commit0771591fe1068c9b437bb92d3ac372d7c09b2ff3 (patch)
treec85b9d166a826c2134eb0003d1dc51f3b7537462 /Doc/library/functions.rst
parentf287d640addf913526c254bbcd29877025d02bcd (diff)
downloadcpython-0771591fe1068c9b437bb92d3ac372d7c09b2ff3.zip
cpython-0771591fe1068c9b437bb92d3ac372d7c09b2ff3.tar.gz
cpython-0771591fe1068c9b437bb92d3ac372d7c09b2ff3.tar.bz2
Merged revisions 83593 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83593 | georg.brandl | 2010-08-02 23:44:25 +0200 (Mo, 02 Aug 2010) | 57 lines Merged revisions 83536,83546-83548,83550,83554-83555,83558,83563,83565,83571,83574-83575 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83536 | georg.brandl | 2010-08-02 19:49:25 +0200 (Mo, 02 Aug 2010) | 1 line #8578: mention danger of not incref'ing weak referenced object. ........ r83546 | georg.brandl | 2010-08-02 21:16:34 +0200 (Mo, 02 Aug 2010) | 1 line #7973: Fix distutils options spelling. ........ r83547 | georg.brandl | 2010-08-02 21:19:26 +0200 (Mo, 02 Aug 2010) | 1 line #7386: add example that shows that trailing path separators are stripped. ........ r83548 | georg.brandl | 2010-08-02 21:23:34 +0200 (Mo, 02 Aug 2010) | 1 line #8172: how does one use a property? ........ r83550 | georg.brandl | 2010-08-02 21:32:43 +0200 (Mo, 02 Aug 2010) | 1 line #9451: strengthen warning about __*__ special name usage. ........ r83554 | georg.brandl | 2010-08-02 21:43:05 +0200 (Mo, 02 Aug 2010) | 1 line #7280: note about nasmw.exe. ........ r83555 | georg.brandl | 2010-08-02 21:44:48 +0200 (Mo, 02 Aug 2010) | 1 line #8861: remove unused variable. ........ r83558 | georg.brandl | 2010-08-02 22:05:19 +0200 (Mo, 02 Aug 2010) | 1 line #8648: document UTF-7 codec functions. ........ r83563 | georg.brandl | 2010-08-02 22:21:21 +0200 (Mo, 02 Aug 2010) | 1 line #9037: add example how to raise custom exceptions from C code. ........ r83565 | georg.brandl | 2010-08-02 22:27:20 +0200 (Mo, 02 Aug 2010) | 1 line #9111: document that do_help() looks at docstrings. ........ r83571 | georg.brandl | 2010-08-02 22:44:34 +0200 (Mo, 02 Aug 2010) | 1 line Clarify that abs() is not a namespace. ........ r83574 | georg.brandl | 2010-08-02 22:47:56 +0200 (Mo, 02 Aug 2010) | 1 line #6867: epoll.register() returns None. ........ r83575 | georg.brandl | 2010-08-02 22:52:10 +0200 (Mo, 02 Aug 2010) | 1 line #9238: zipfile does handle archive comments. ........ ................
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index a70a29d..f24c46d 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -864,7 +864,7 @@ available. They are listed here in alphabetical order.
*fget* is a function for getting an attribute value, likewise *fset* is a
function for setting, and *fdel* a function for del'ing, an attribute. Typical
- use is to define a managed attribute x::
+ use is to define a managed attribute ``x``::
class C(object):
def __init__(self):
@@ -878,6 +878,9 @@ available. They are listed here in alphabetical order.
del self._x
x = property(getx, setx, delx, "I'm the 'x' property.")
+ If then *c* is an instance of *C*, ``c.x`` will invoke the getter,
+ ``c.x = value`` will invoke the setter and ``del c.x`` the deleter.
+
If given, *doc* will be the docstring of the property attribute. Otherwise, the
property will copy *fget*'s docstring (if it exists). This makes it possible to
create read-only properties easily using :func:`property` as a :term:`decorator`::