En Wed, 05 Mar 2008 00:30:26 -0200, <[EMAIL PROTECTED]> escribió: > On Mar 4, 8:11 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Tue, 04 Mar 2008 16:45:40 -0200, <[EMAIL PROTECTED]> escribió: >> >> >> Can you overload -type-'s decision of what to 'bind'?... whenever it >> >> is it makes it. >> >> >>>> from types import FunctionType, MethodType >> >>>> class A( FunctionType ): pass >> > ... >> > Traceback (most recent call last): >> > File "<stdin>", line 1, in <module> >> > TypeError: type 'function' is not an acceptable base type >> >> Use delegation instead of inheritance. This class is almost >> indistinguishable from a true function (when used as a method):
[... long interactive example ...] > I actually don't believe you-- bar is not bound to an instance when P > is initialized... er, instantiated. However, the evidence indicates > my belief mechanism is faulty... and rather conclusively at that. > <moves to acquire new evidence> If P calls __get__( you ), is p a > gotcha? I didn't cheat, that was an actual Python interactive session. So you'll have to formulate a new theory taking into account the new facts... or read how the descriptor protocol works http://www.python.org/doc/newstyle/ I don't understand your last sentence. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list