J
John Hunter
What is the best way to get a list of all functions actually defined
in a module, ignoring those functions that the module may have
imported but not defined?
The following gets a list of all the callables, but includes functions
that some.module imports
funcs = []
for o in dir(some.module):
if o.startswith('_'): continue
p = getattr(some.module, o)
if not callable(p): continue
funcs.append(p)
JDH
in a module, ignoring those functions that the module may have
imported but not defined?
The following gets a list of all the callables, but includes functions
that some.module imports
funcs = []
for o in dir(some.module):
if o.startswith('_'): continue
p = getattr(some.module, o)
if not callable(p): continue
funcs.append(p)
JDH