summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-12 01:32:03 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-12 01:32:03 (GMT)
commit96f31636f4af949dd0975c9381d284915c9d76f6 (patch)
tree61de113ffa9a0011ca4280a208f825dc726b4438 /Objects
parent29fd7120e420014d5c32f5864a1d3c19ffa73c7f (diff)
downloadcpython-96f31636f4af949dd0975c9381d284915c9d76f6.zip
cpython-96f31636f4af949dd0975c9381d284915c9d76f6.tar.gz
cpython-96f31636f4af949dd0975c9381d284915c9d76f6.tar.bz2
Merged revisions 58930-58938 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r58931 | vinay.sajip | 2007-11-11 15:27:30 +0100 (Sun, 11 Nov 2007) | 1 line Fixed a bug reported (in private email, by Robert Crida) in logging configuration whereby child loggers of a logger named in a configuration file, which are not themselves named in the configuration, are disabled when the configuration is applied. ........ r58932 | georg.brandl | 2007-11-11 16:16:16 +0100 (Sun, 11 Nov 2007) | 2 lines Remove duplication of "this". ........ r58935 | christian.heimes | 2007-11-12 02:15:40 +0100 (Mon, 12 Nov 2007) | 2 lines Added new decorator syntax to property.__doc__ Guido prefers _x over __x. ........ r58936 | christian.heimes | 2007-11-12 02:20:56 +0100 (Mon, 12 Nov 2007) | 2 lines Fix for #1427: Error in standard module calendar the prweek() method is still broken and I can't figure out how it suppose to work. ........ r58938 | andrew.kuchling | 2007-11-12 02:25:21 +0100 (Mon, 12 Nov 2007) | 1 line Re-word sentence ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/descrobject.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index a0fc217..8e4dd2e 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1259,10 +1259,20 @@ PyDoc_STRVAR(property_doc,
"fset is a function for setting, and fdel a function for del'ing, an\n"
"attribute. Typical use is to define a managed attribute x:\n"
"class C(object):\n"
-" def getx(self): return self.__x\n"
-" def setx(self, value): self.__x = value\n"
-" def delx(self): del self.__x\n"
-" x = property(getx, setx, delx, \"I'm the 'x' property.\")");
+" def getx(self): return self._x\n"
+" def setx(self, value): self._x = value\n"
+" def delx(self): del self._x\n"
+" x = property(getx, setx, delx, \"I'm the 'x' property.\")\n"
+"\n"
+"Decorators make defining new properties or modifying existing ones easy:\n"
+"class C(object):\n"
+" @property\n"
+" def x(self): return self._x\n"
+" @x.setter\n"
+" def x(self, value): self._x = value\n"
+" @x.deleter\n"
+" def x(self): del self._x\n"
+);
static int
property_traverse(PyObject *self, visitproc visit, void *arg)