Wednesday, October 9, 2013

Attribution

>>> class Attribution(object):
...    def __init__(self):
...       self.instance = "instance"
...    type = "type"
...    def __getattr__(self, key):
...       return "__getattr__"
...
>>> a = Attribution()
>>> a.instance
'instance'
>>> a.type
'type'
>>> a.b
'__getattr__'

No comments:

Post a Comment