"What is the name of the function/method that called me?"

Moshe Zadka moshez at math.huji.ac.il
Sun Oct 17 02:20:45 EDT 1999


[Posted and CCed to author]

On 17 Oct 1999, Cameron Laird wrote:

> Is there a profound and/or interesting
> reason Python doesn't provide the kinds
> of introspective features we're discus-
> sing here (a traceback, for example)
> without the detour through the land of
> exception-tossing?

Yes. It is a reminder that IT SHOULDN'T BE DONE (sorry for shouting).
Introspecting into "static" stuff (like classes, methods, etc.) is
/moderately/ ok (though it is usually more a sign the design was wrong).
However, introspecting into /dynamic/ data should be available (because
the debugger needs it) but obscure (because anyone doing this for the
runtime of his program is commiting a shooting offense). If someone needs
this information to debug his program, they should use the debugger.

--
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.





More information about the Python-list mailing list