How to get self reference from within a module?

Gabriel Genellina gagsl-py at yahoo.com.ar
Tue Jan 23 02:15:00 CET 2007


At Monday 22/1/2007 20:26, Lavoie Érick wrote:

>  i would like to now how to get a self 
> reference from within a module.  The goal is to 
> be able to generate a list of all declared function within the module.

 From inside the module, use globals() - that 
includes all defined symbols (classes, imported 
modules, functions, etc). You can filter them 
using inspect.isfunction by example.


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