module functions list

Peter Otten __peter__ at
Wed Aug 25 15:01:11 CEST 2004

Diez B. Roggisch wrote:

> Hi,
>> You could use a list comprehension coupled with a filter:
>> functionList = [function for function in dir(objectName) \
>>     if callable(getattr(objectName,function))]
Note that callable() will not filter out classes. If you want to exclude
classes from your list, have a look at inspect.isfunction() or

> That works if objectName is my module - but how do I get a reference to
> the current module _inside_ my module? Thats the hart part (at least for
> me ...)



More information about the Python-list mailing list