What is the relationship between __getattr__ and getattr 
<p>i know this code is right </p>

<pre><code>class A:   
    def __init__(self):
        self.a = 'a'  
    def method(self):   
        print "method print"  

a = A()   
print getattr(a, 'a', 'default')   
print getattr(a, 'b', 'default')  
print getattr(a, 'method', 'default') 
getattr(a, 'method', 'default')()
</code></pre>

<p>but the next is wrong,</p>

<pre><code>dose __getattr__ will affect the getattr

class a(object):
    def __getattr__(self,name):
        return 'xxx'
print getattr(a)
</code></pre>

<p>the next is also wrong </p>

<pre><code>a={'aa':'aaaa'}
print getattr(a,'aa')

so,i want to know which place use this two function(__getattr__ and getattr)
</code></pre>

<p>Please try to use the code, rather than text, because my English is not very good, thank you</p>
