Popular recipes tagged "caller"http://code.activestate.com/recipes/tags/caller/popular/2013-03-07T08:37:32-08:00ActiveState Code RecipesCaller and Callee (Python)
2013-03-07T08:37:32-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578483-caller-and-callee/
<p style="color: grey">
Python
recipe 578483
by <a href="/recipes/users/4183429/">Deepak</a>
(<a href="/recipes/tags/callee/">callee</a>, <a href="/recipes/tags/caller/">caller</a>, <a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>A recipe to find out which function is the caller of the current function. </p>
<p>The <code>caller</code> function can be helpful for debugging — if there is no real debugger available. In terms of software engineering (loose coupling etc.) this should not be used in production code though.</p>
Get full caller name (package.module.function) (Python)
2012-11-30T21:54:46-08:00anatoly techtonikhttp://code.activestate.com/recipes/users/4168147/http://code.activestate.com/recipes/578352-get-full-caller-name-packagemodulefunction/
<p style="color: grey">
Python
recipe 578352
by <a href="/recipes/users/4168147/">anatoly techtonik</a>
(<a href="/recipes/tags/caller/">caller</a>, <a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/logging/">logging</a>).
</p>
<p>This function allows to get fully qualified name of the calling function. I expected this field to be available from logging module, but it is not here <a href="http://docs.python.org/2/library/logging.html#logrecord-attributes" rel="nofollow">http://docs.python.org/2/library/logging.html#logrecord-attributes</a> It might be that it is too expensive for performance or just doesn't play well in some situations. I don't know. I use it solely when debugging and it is convenient.</p>
<p>Also here: <a href="https://gist.github.com/2151727" rel="nofollow">https://gist.github.com/2151727</a></p>
Caller and Callee (Python)
2010-03-26T20:04:11-07:00Michael Grünewaldhttp://code.activestate.com/recipes/users/4172244/http://code.activestate.com/recipes/576925-caller-and-callee/
<p style="color: grey">
Python
recipe 576925
by <a href="/recipes/users/4172244/">Michael Grünewald</a>
(<a href="/recipes/tags/callee/">callee</a>, <a href="/recipes/tags/caller/">caller</a>, <a href="/recipes/tags/debugging/">debugging</a>).
Revision 4.
</p>
<p>A recipe to find out which function is the caller of the current function. </p>
<p>The <code>caller</code> function can be helpful for debugging — if there is no real debugger available. In terms of software engineering (loose coupling etc.) this should not be used in production code though.</p>