Finding the calling method (or caller)
Aahz
aahz at pythoncraft.com
Fri Jan 17 13:43:38 EST 2003
In article <mailman.1042767154.29348.python-list at python.org>,
Chad Netzer <cnetzer at mail.arc.nasa.gov> wrote:
>On Thursday 16 January 2003 16:56, Aahz wrote:
>>
>> Why do you want to know this? There's likely to be a better way than
>> using sys._getframe().
>
>I use introspection techniques like this to enforce calling through the
>"public" api, and not the private.
Why not just use methods with leading underscores?
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"I used to have a .sig but I found it impossible to please everyone..." --SFJ
More information about the Python-list
mailing list