Skip to content

Instantly share code, notes, and snippets.

@skimbrel
Created November 4, 2013 22:32
Show Gist options
  • Save skimbrel/7310374 to your computer and use it in GitHub Desktop.
Save skimbrel/7310374 to your computer and use it in GitHub Desktop.
In [1]: class Foo(object):
...: def bar(self):
...: print 'hi'
...:
In [2]: f = Foo()
In [3]: f.__dict__['bar']()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-3-b73fd9ab5080> in <module>()
----> 1 f.__dict__['bar']()
KeyError: 'bar'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment