Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created February 25, 2014 14:59
Show Gist options
  • Select an option

  • Save dstufft/9210459 to your computer and use it in GitHub Desktop.

Select an option

Save dstufft/9210459 to your computer and use it in GitHub Desktop.
>>> def __one__(self):
... pass
...
>>> class Foo:
... __two__ = __one__
... def __three__(self):
... pass
...
>>> Foo.__four__ = __one__
>>> obj = Foo()
>>> obj.__five__ = __one__
>>> type(__one__)
<class 'function'>
>>> type(Foo.__two__)
<class 'function'>
>>> type(Foo.__three__)
<class 'function'>
>>> type(Foo.__four__)
<class 'function'>
>>> type(obj.__two__)
<class 'method'>
>>> type(obj.__three__)
<class 'method'>
>>> type(obj.__four__)
<class 'method'>
>>> type(obj.__five__)
<class 'function'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment