[Python-3000] Bound and unbound methods

Thomas Wouters thomas at python.org
Sun Aug 13 23:22:32 CEST 2006


On 8/13/06, Talin <talin at acm.org> wrote:

> Hmmmm....I wonder if it could be me made to work in a
> backwards-compatible way. In other words, suppose the existing logic of
> creating a method object were left in place, however the
> 'obj.instancemethod()' pattern would bypass all of that. In other words,
> the compiler would note the combination of the attribute access and the
> call, and combine them into an opcode that skips the whole method
> creation step. (Maybe it already does this and I'm just being stupid.)


Been there, done that, bought the T-shirt (well, it was just a PyCon-1
T-shirt):

http://sourceforge.net/tracker/index.php?func=detail&aid=709744&group_id=5470&atid=305470

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.

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20060813/5d70b8e9/attachment.html 


More information about the Python-3000 mailing list