Quantify over all functions of a module

Fredrik Lundh fredrik at pythonware.com
Mon Dec 8 08:30:40 EST 2003


> something like this might work:
>
>     for name, func in vars(test2):
>         if not name.startswith("__") and callable(func):
>             func_list.append(func)

ahem.  better make that:

    for name, func in vars(test2).items():
        if not name.startswith("__") and callable(func):
            func_list.append(func)

</F>








More information about the Python-list mailing list