mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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 ........
This commit is contained in:
parent
29fd7120e4
commit
96f31636f4
4 changed files with 54 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue