Skip to content

Instantly share code, notes, and snippets.

@yipyip
Created July 31, 2013 10:52
Show Gist options
  • Save yipyip/6121099 to your computer and use it in GitHub Desktop.
Save yipyip/6121099 to your computer and use it in GitHub Desktop.
...
try:
getattr(myobject, 'a_method')
except AttributeError:
return 0
else:
return callable(getattr(myobject, 'a_method'))
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment