I am using this simple example to understand Python's getattr function:
In [25]: class Foo:
....: def __getattr__(self, name):
....: print name
....:
....:
In [26]: f = Foo()
In [27]: f.bar
bar
bar
Why is bar
printed twice? Using Python 2.6.5.