Finding the calling method
Aahz
aahz at pythoncraft.com
Thu Jan 16 19:56:10 EST 2003
In article <df392399.0301141226.1554a055 at posting.google.com>,
Mark <itcram at yahoo.com> wrote:
>
>I don't know if you there is a function or method you can call to find
>this. Inside a method(method A) I'm calling another method(method B)
>inside the same class. Is there a way while I'm inside method B to
>find out what method called it, which would be method A. Do I have to
>look at the stack or is there a function to call?
Why do you want to know this? There's likely to be a better way than
using sys._getframe().
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"I used to have a .sig but I found it impossible to please everyone..." --SFJ
More information about the Python-list
mailing list