Eval the caller within a method?

Franz GEIGER fgeiger at datec.at
Sat Oct 21 05:20:32 EDT 2000


I wonder if in Python there is a possibility to evaluate the method which
called a method within that method like it is in Perl.

This would prevent me from having to write code like
logIt = TLog("Callers name")
logIt("Some diagnostics");

(printing:
"'Callers name': Entered. "
"Callers name': Some diagnostics"
)

because TLog() could figure out which method called it.

Any ideas?

Best regards
Franz GEIGER






More information about the Python-list mailing list