billiejoex schrieb:
> Hi there,
> unfortunately, I'm compelled to apply a sort of monkey patching at the
> code of an existing libreary that I can't modify directly.
> Here's my question
> Having such code:
>
> class test:
>
>     def caller(self):
>         self.b()
>
>     def called(self):
>         pass
>
> ...(if it is possible) how can I get, from method "called", the name
> of function/method that called it (in this case "caller")?
>
> Thanks in advance
>
>   
inspect.stack is your friend ;-)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to