What *instance* called me & proxy methods

Carlos Alberto Reis Ribeiro cribeiro at mail.inet.com.br
Wed Mar 28 20:31:55 CEST 2001

At 10:07 28/03/01 -0800, Ken Seehof wrote:
>You want 'im_self'.

Ken, I checked this *before* posting my first message. In fact I cited this 
in my original message... First, in this paragraph, where I'm stating that 
I'm not looking for self:

> > Can I know what *instance* called a method? I'm not talking about "self"
> > here, because we *can* call a method using other techniques, such as
> > copying the instance method pointer directly:

And then here, when I said that I know about the im_self attribute (and 
about its companions as well).

> > In both cases, hello() received the same value as the self parameter. This
> > is exactly what I need; in fact, the im_self attribute of the instance
> > method stores the pointer to self, which explains this behavior.

Please check my examples. My question is not about how to know about "self" 
or "im_self". When I attach a instance method to my proxy, the value of 
im_self is kept the same(see the first example). I would like to have some 
way to know if the call was redirected through my proxy. My second example 
shows how I did manage to achieve it, but I'm not satisfied with the solution.

Carlos Ribeiro

More information about the Python-list mailing list