summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libfuncs.tex
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-03-08 18:09:27 (GMT)
committerGeorg Brandl <georg@python.org>2006-03-08 18:09:27 (GMT)
commit533ff6fc0622bfae5d13d3a3838fbec3d9d21092 (patch)
tree9650a936ff5061230485f1a3f4e4a6d90470250a /Doc/lib/libfuncs.tex
parentf3c4ad14104ad45bd53df7b7e63cfc889efc3c05 (diff)
downloadcpython-533ff6fc0622bfae5d13d3a3838fbec3d9d21092.zip
cpython-533ff6fc0622bfae5d13d3a3838fbec3d9d21092.tar.gz
cpython-533ff6fc0622bfae5d13d3a3838fbec3d9d21092.tar.bz2
Patch #1434038: property() now uses the getter's docstring if there is
no "doc" argument given. This makes it possible to legitimately use property() as a decorator to produce a read-only property.
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r--Doc/lib/libfuncs.tex5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index 12dbc0c..9b6bfe9 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -771,7 +771,12 @@ class C(object):
x = property(getx, setx, delx, "I'm the 'x' property.")
\end{verbatim}
+ If given, \var{doc} will be the docstring of the property attribute.
+ Otherwise, the property will copy \var{fget}'s docstring (if it
+ exists).
+
\versionadded{2.2}
+ \versionchanged[Use \var{fget}'s docstring if no \var{doc} given]{2.5}
\end{funcdesc}
\begin{funcdesc}{range}{\optional{start,} stop\optional{, step}}