title: Python : getattr expected at least 2 arguments, got 1
body: <p>I have got a beginner problem. I would like to get an attribute from an instance. It work fine when i use getattr with 2 separeted arguments (object and the name of the attribute). </p>
  
  <p>But I read that it's possible to just use one argument (like this : obj.attr). When I try it, I get an error : getattr expected at least 2 arguments, got 1. Why does it not work ?</p>
  
  <pre><code>class test :
      def __init__ (self) :
          self.name = "a"
  
  inst = test()
  
  print getattr (inst, "name")
  print getattr (inst.name)
  
  a
  # Error: getattr expected at least 2 arguments, got 1
  # Traceback (most recent call last):
  #   File "&lt;maya console&gt;", line 8, in &lt;module&gt;
  # TypeError: getattr expected at least 2 arguments, got 1 #
  </code></pre>