Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Created January 31, 2014 10:11
Show Gist options
  • Save iolloyd/8729502 to your computer and use it in GitHub Desktop.
Save iolloyd/8729502 to your computer and use it in GitHub Desktop.
An example of how to make a class callable as an instance in python
class Foo:
def __call__(self):
print 'you called me'
caller = Foo()
caller()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment