Hooking any/all 'calls'

Kevin Little kevin_little at comkast.net.k2c
Wed Dec 27 21:07:14 EST 2006


In Python 2.4 or 2.5, what is the easiest way to hook any and all
callables such that designated code is executed at the very start and
end of each call? (Yes, I'm trying to come up with a little debugging
tool!:) Is there a single metaclass who's "__call__" method can be
wrapped to do this?

TIA,
   -k
 



More information about the Python-list mailing list