[Zope-dev] Is there a way to find out where a method is defined?

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 07 Feb 2000 07:58:32 +0000


On Sat, 05 Feb 2000 09:55:07 -0500, Andrew Wilcox <circle@gwi.net>
wrote:

>Is there a way in the runtime or in the debugger, perhaps through the magic
>of Python reflection, to ask "when I call this method on this object, this
>is the class providing the definition?"

It might not be the most convenient way, but you can get an accurate
answer using the Monitor.......


Welcome to <secure_monitor_channel connected 127.0.0.1:1669
at f1fe30>
[Hint: try 'from __main__ import *']
>>> import Zope
>>> z=Zope.app()
>>> z.zc.manage_delObjects.im_func.func_code
------
2000-02-07T07:57:47 INFO(0) ZServer <code object manage_delO
bjects at ac77d0, file "D:\zope2\lib\python\OFS\ObjectManage
r.py", line 373>
>>>



Toby Dickenson
tdickenson@geminidataloggers.com