D
Diez B. Roggisch
Hi,
this strikes me as a pretty basic question, but google didn't help, so I'm
asking it here:
How do I get a list of functions defined in a module in the module itself?
Like this:
--- module functions.py
def foo():
return 1
def bar():
return 1
def all_functions():
return <some magic code that yields [foo, bar]>
---
The application for this is that I want a bunch of predefined functions for
a small expression interpreter of mine to be collected in one module and
get them all without an explicit "registration" process.
Any ideas?
this strikes me as a pretty basic question, but google didn't help, so I'm
asking it here:
How do I get a list of functions defined in a module in the module itself?
Like this:
--- module functions.py
def foo():
return 1
def bar():
return 1
def all_functions():
return <some magic code that yields [foo, bar]>
---
The application for this is that I want a bunch of predefined functions for
a small expression interpreter of mine to be collected in one module and
get them all without an explicit "registration" process.
Any ideas?