Who's the caller ?
Alex Martelli
aleaxit at yahoo.com
Thu Apr 5 05:30:12 EDT 2001
<aboufer at atlsci.com> wrote in message news:3ACB3071.D8B43BC1 at atlsci.com...
> Greetins all,
>
> Is it possible for a callee to determine who is the caller ?
Yes, to some extent (i.e., for some definition of 'who'!-),
indirectly, by raising and catching any exception and studying
the resulting traceback frames. This will tell you about
the *functions* involved in the calling. It's harder if
you're trying to ascertain the *objects* involved...
Alex
More information about the Python-list
mailing list