Skip to content

Instantly share code, notes, and snippets.

@zfogg
Created May 6, 2012 01:41
Show Gist options
  • Save zfogg/2606935 to your computer and use it in GitHub Desktop.
Save zfogg/2606935 to your computer and use it in GitHub Desktop.
def membersOfType(o, *types):
return dict(
[(m, a)
for m, a in map(lambda x: (x, getattr(o, x)), dir(o))
if any([isinstance(a, t) for t in types])])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment