title: Python object returning function only with getattr
body: <p>On <a href="http://effbot.org/zone/python-getattr.htm" rel="nofollow">http://effbot.org/zone/python-getattr.htm</a> it states that</p>
  
  <blockquote>
  <pre><code>Python’s getattr function is used to fetch an attribute from an object, using 
  a string object instead of an identifier to identify the
  attribute. In other words, the following two statements are
  equivalent:
  
      value = obj.attribute
      value = getattr(obj, "attribute")
  </code></pre>
  </blockquote>
  
  <p>What is confuses me is that I have a module with a class with dynamic classmethod generation. I know that the generation works because calling __dict__ returns</p>
  
  <pre><code> &gt;&gt;&gt; errors.__dict__
  mappingproxy({'__module__': 'utils.errors', '__weakref__': 
  &lt;attribute '__weakref__' of 'errors' objects&gt;,'404': &lt;classmethod object at 
  0x7fe547c23190&gt;, '500': &lt;classmethod object at 0x7fe547c23210&gt;, '403': 
  &lt;classmethod object at 0x7fe547c23110&gt;, '400': &lt;classmethod object at 
  0x7fe547c23090&gt;})
  </code></pre>
  
  <p>What is confusing me is the face that getattr works, while calling the attribute directly does not</p>
  
  <pre><code>&gt;&gt;&gt; errors.404("asdf")
    File "&lt;console&gt;", line 1
      errors.404("asdf")
               ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt; getattr(errors,'404')("asdf")
  {'error': 'Page Not Found', 'code': 404, 'message': 'asdf'}
  </code></pre>