Skip to content

Instantly share code, notes, and snippets.

@martinthenext
Created September 1, 2011 08:01
Show Gist options
  • Save martinthenext/1185675 to your computer and use it in GitHub Desktop.
Save martinthenext/1185675 to your computer and use it in GitHub Desktop.
what.py
>>> class ca11able(object):
def __init__(self):
a = 2
def __call__(self):
a += 1
>>> c = ca11able
>>> c()
<__main__.ca11able object at 0x0000000002C949E8>
>>> c = ca11able()
>>> c.a
Traceback (most recent call last):
File "<pyshell#80>", line 1, in <module>
c.a
AttributeError: 'ca11able' object has no attribute 'a'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment