Hooking any/all 'calls'

Gabriel Genellina gagsl-py at yahoo.com.ar
Wed Dec 27 21:22:33 EST 2006


At Wednesday 27/12/2006 23:07, Kevin Little wrote:

>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?

See Stain Soiland's site http://soiland.no/software/decorator for his 
logging decorator and logging metaclass.


-- 
Gabriel Genellina
Softlab SRL 


	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




More information about the Python-list mailing list