<br><br><div><span class="gmail_quote">On 8/13/06, <b class="gmail_sendername">Talin</b> <<a href="mailto:talin@acm.org">talin@acm.org</a>> wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hmmmm....I wonder if it could be me made to work in a<br>backwards-compatible way. In other words, suppose the existing logic of<br>creating a method object were left in place, however the<br>'obj.instancemethod()' pattern would bypass all of that. In other words,
<br>the compiler would note the combination of the attribute access and the<br>call, and combine them into an opcode that skips the whole method<br>creation step. (Maybe it already does this and I'm just being stupid.)</blockquote>
<div><br>Been there, done that, bought the T-shirt (well, it was just a PyCon-1 T-shirt):<br><br><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=709744&group_id=5470&atid=305470">http://sourceforge.net/tracker/index.php?func=detail&aid=709744&group_id=5470&atid=305470
</a><br><br>Back then, the end result of that particular change was very tiny, and it wasn't even taking new-style classes into account (which would have made it more complex.) It may be worth re-trying anyway, especially for python-3000: no classic classes to worry about. And quite a lot has changed in the compiler and opcode dispatcher in the mean time. I am completely -1 on getting rid of bound methods, though.
<br></div></div><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!