Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (8 sloc) 366 Bytes
#!/usr/bin/env python
# Steven Phillips / elimisteve
# 2015.07.15
import inspect
def instances_in_module(cls, module):
return [instance for name, instance in inspect.getmembers(module, lambda inst: isinstance(inst, cls))]
def vars_by_name_in_module(predicate, module):
return [instance for name, instance in inspect.getmembers(module) if predicate(name)]