<br><font size=2 face="sans-serif">Classification: Public<br>
<br>
Hello,</font>
<br>
<br><font size=2 face="sans-serif">thanks for your feedback. Let me further
explain why I think the doc is unclear to me here. Maybe I am missing something.</font>
<br>
<br><font size=2 face="sans-serif">A little bit earlier documentation mentions:</font>
<br>
<br><font size=3>"This makes it possible to create read-only properties
easily using </font><a href=http://docs.python.org/library/functions.html#property><tt><font size=3 color=blue><u>property()</u></font></tt></a><font size=3>
as a </font><a href="http://docs.python.org/glossary.html#term-decorator"><font size=3 color=blue><i><u>decorator</u></i></font></a><font size=3>:
</font><font size=2 face="sans-serif">"</font>
<br>
<br><font size=2 face="sans-serif">implying property to be the key to creating
a read-only property.</font>
<br>
<br><font size=2 face="sans-serif">In conjunction with: "</font><font size=3>A
property object has </font><tt><font size=3>getter</font></tt><font size=3>,
</font><tt><font size=3>setter</font></tt><font size=3>, and </font><tt><font size=3>deleter</font></tt><font size=3>
methods usable as decorators that create a copy of the property with the
<b>corresponding accessor </b>function set to the decorated function. This
is best explained with an example: </font><font size=2 face="sans-serif">"</font>
<br>
<br><font size=2 face="sans-serif">The description implies the decorator
for a getter to be @x.getter and not @property.</font>
<br><font size=2 face="sans-serif">I am of the impression that property()
would only be used for creating read-only properties while x.getter, x.setter,
x.deleter decorators create read-writable properties.</font>
<br><font size=2 face="sans-serif">It is unclear here when a read-only
property is created and when a read-write property is created.</font>
<br>
<br><font size=2 face="sans-serif">Then "</font><font size=3>This
code is exactly equivalent to the first example.</font><font size=2 face="sans-serif">"
is not true. The second example is about a read-write property while the
first example is about a read-only property. It contains two additional
methods. Just remove the sentence.</font>
<br>
<br><font size=2 face="sans-serif">IMHO what should be explicitely mentioned
is </font>
<br><font size=2 face="sans-serif">1. why symmetry is broken for @property
vs @propertyname.setter and @propertyname.deleter, and</font>
<br><font size=2 face="sans-serif">2. how python determines to create a
read-only or a read-write property (is it just the existence of setter
and deleter decorators/methods?)<br>
</font>
<br><font size=2 face="sans-serif">Regards, Andreas<br>
<br>
______________________________________________________________________________<br>
<br>
Andreas Balogh <br>
Domain Manager<br>
Global Technology Capital Markets | Business Solutions | Global Markets
Equity<br>
Deutsche Bank AG | Große Gallusstraße 10-14 | 60311 Frankfurt am Main |
Germany<br>
Tel: +49 69 910 39518 | Fax : +49 69 910 32260<br>
______________________________________________________________________________<br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Sandro Tosi <sandro.tosi@gmail.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: matrixhasu@gmail.com</font>
<p><font size=1 face="sans-serif">28.01.2012 19:44</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Andreas Balogh <andreas.balogh@db.com></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">docs@python.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [docs] documentation bug</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hello Andreas,<br>
thanks for your email.<br>
<br>
On Thu, Jan 26, 2012 at 15:28, Andreas Balogh <andreas.balogh@db.com>
wrote:<br>
> @property<br>
> def x(self):<br>
> """I'm the 'x' property."""<br>
> return self._x<br>
...<br>
> should read correctly<br>
...<br>
> @x.getter<br>
> def x(self):<br>
> """I'm the 'x' property."""<br>
> return self._x<br>
<br>
I'm not exactly sure that the example is incorrect, the writer might<br>
have wanted to recall the property decorator of the example above<br>
instead of using the getter decorator.<br>
<br>
Regards,<br>
-- <br>
Sandro Tosi (aka morph, morpheus, matrixhasu)<br>
My website: http://matrixhasu.altervista.org/<br>
Me at Debian: http://wiki.debian.org/SandroTosi<br>
</font></tt>
<br>
<br>
<span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#000000">-- </span><br>
<br>
<span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#000000">Informationen (einschließlich Pflichtangaben) zu einzelnen, innerhalb der EU tätigen Gesellschaften und Zweigniederlassungen des Konzerns Deutsche Bank finden Sie unter </span><span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#0000ff"><u>http://www.deutsche-bank.de/de/content/pflichtangaben.htm</u></span><span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#000000">. Diese E-Mail enthält vertrauliche und/ oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.</span><br>
<br>
<span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#000000">Please refer to </span><span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#0000ff"><u>http://www.db.com/en/content/eu_disclosures.htm</u></span><span style="font-family:'Microsoft Sans Serif',sans-serif; font-size:8pt; color:#000000"> for information (including mandatory corporate particulars) on selected Deutsche Bank branches and group companies registered or incorporated in the European Union. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.</span>