title: How to get instance variables in Python?
body: <p>Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code:</p>
  
  <pre><code>class hi:
    def __init__(self):
      self.ii = "foo"
      self.kk = "bar"
  </code></pre>
  
  <p>Is there a way for me to do this:</p>
  
  <pre><code>&gt;&gt;&gt; mystery_method(hi)
  ["ii", "kk"]
  </code></pre>
  
  <p>Edit: I originally had asked for class variables erroneously.</p>