who is my caller?
Clark C. Evans
cce at clarkevans.com
Tue Mar 27 10:15:14 EST 2001
On Tue, 27 Mar 2001, Emile van Sebille wrote:
> If I'm not mistaken, with 2.0 you can directly import traceback without
> needing to generate an exception first.
I was actually looking to do something like..
caller = traceback.call_stack.top()
try:
if '0h3kfd' = caller.check('key'):
# ok... you passed security
except:
pass
A string print-out is useless... I'm after
the function objects....
This brings up another question, if I
have a function can I get the module
handle; or if I have a bound-function can
I fetch the object that it is part of?
Thanks!
Clark
More information about the Python-list
mailing list