From: Robert Klemme Date: 2007-08-03T22:25:14+09:00 Subject: Re: Getting the 'Sender' or 'Caller' object of a method 2007/8/3, Peter Laurens : > Hi, > > I am not having much luck in finding out how to get the calling object > of a method. > > Is there an implicit way that a method can get a pointer to the object > that called it, or do I have to write that explicitly, manually > including a 'sender' parameter for the method call myself? > > I have looked at 'caller' but can only coax a string out of it. Depends on what you want to do. If it's for debugging purposes you can use set_trace_func to keep track of callers or just trace the whole program execution. If you need it for your program logic then you should pass the caller - either as method parameter or set it as an attribute before the call. Depends on what you do which is more appropriate. Kind regards robert