Created
September 1, 2011 08:01
-
-
Save martinthenext/1185675 to your computer and use it in GitHub Desktop.
what.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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