Return name of caller function?

Matthew Peter survivedsushi at yahoo.com
Mon Jun 25 21:27:29 EDT 2007


For example, how do I get this to work?

def func():
    print "This is", __?__
    return __caller__

def echo():
    print "This is ", __?__
    return func()


>>> print echo()
This is echo
This is func
echo



       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC



More information about the Python-list mailing list