New submission from Christian Heimes:

The patch adds the new syntax to the doc string of property:

Decorators makes defining new or modifying existing properties easy:
class C(object):
    @property
    def x(self): return self.__x
    @x.setter
    def x(self, value): self.__x = value
    @x.deleter
    def x(self): del self.__x

----------
assignee: gvanrossum
components: Interpreter Core
files: property_docstring.patch
keywords: patch
messages: 57385
nosy: gvanrossum, tiran
priority: low
severity: normal
status: open
title: Update to property.__doc__
type: rfe
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file8735/property_docstring.patch

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1428>
__________________________________
Index: Objects/descrobject.c
===================================================================
--- Objects/descrobject.c	(Revision 58931)
+++ Objects/descrobject.c	(Arbeitskopie)
@@ -1271,7 +1271,17 @@
 "    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.\")");
+"    x = property(getx, setx, delx, \"I'm the 'x' property.\")\n"
+"\n"
+"Decorators makes defining new or modifying existing properties 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)
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to