Skip to content

Instantly share code, notes, and snippets.

@adh
Created November 24, 2010 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adh/714552 to your computer and use it in GitHub Desktop.
Save adh/714552 to your computer and use it in GitHub Desktop.
Python 2.6.5+ (release26-maint, Jul 6 2010, 12:58:20)
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
... def __call__(self):
... return self
...
>>> Foo()
<__main__.Foo instance at 0x7fea76c053f8>
>>> Foo()
<__main__.Foo instance at 0x7fea76c05488>
>>> foo = Foo()
>>> foo()
<__main__.Foo instance at 0x7fea76c053f8>
>>> foo()
<__main__.Foo instance at 0x7fea76c053f8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment