Not sure I follow all of this, but in general overloading of __call__ should be used rarely -- it's too easy for code to become unreadable otherwise.<br><br>--Guido<br><br><div class="gmail_quote">On Mon, Jun 7, 2010 at 6:40 AM, Michael Foord <span dir="ltr"><<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br><br><div class="gmail_quote">On 7 June 2010 12:34, Michael Foord <span dir="ltr"><<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>[snip...]<div class="im"><div class="gmail_quote"><div>I think you misunderstood, he was suggesting making the property descriptor instances callable. <br><br>Not a bad idea, but as a change to a builtin it would be covered by the language moratorium. Easy to do in a subclass of property though. <br>



<br>At the moment you do the following, which is a bit ugly:<br><br>>>> class Foo(object):<br>...  @property<br>...  def foo(self):<br>...   return 'foo'<br>... <br>>>> f = Foo()<br>>>> Foo.foo.__get__(f)<br>



'foo'<br><br>The reason for wanting to do this are the same reasons as you would call an unbound method.<br><br></div></div></div></blockquote><div><br>Or this which is still slightly ugly but at least gets rid of the magic method call:<div class="im">

<br>
<br>>>> class Foo(object):<br>...  @property<br>...  def foo(self):<br>...   return 'foo'<br>... <br>>>> f = Foo()<br></div>>>> Foo.foo.fget(f)<br>'foo'<br><font color="#888888"><br>

<br>Michael<br><br> </font></div><div class="im">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div>Michael<br> </div><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">




<div><div></div><div><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div></div><font color="#888888"><br><br clear="all"><br>-- <br><a href="http://www.voidspace.org.uk" target="_blank">http://www.voidspace.org.uk</a><br><br><br>
</font></blockquote></div></div><div><div></div><div class="h5"><br><br clear="all"><br>-- <br><a href="http://www.voidspace.org.uk" target="_blank">http://www.voidspace.org.uk</a><br><br><br>
</div></div><br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>