title: How to get attributes of a class without knowing their names
body: <p>I have the following class:</p>
  
  <pre><code>class TestClass(object):
  def __init__(self, **kwargs):
      for key, value in kwargs.items(): #items return list of dict
          setattr(self, key, value)
  </code></pre>
  
  <p>Examplary use:</p>
  
  <pre><code>obj = MessageItem(**{"testkey1":"tval1", "tkey2":"tval2", "tkey3":"tval3"})
  </code></pre>
  
  <p>How can I iterate on this structure without knowing the names of the attributes? Python provides us with the built-in method <code>__getattribute__</code>, but I still need to know the name of the requested attribute:</p>
  
  <pre><code>print(obj.__getattribute__("testkey1"))
  </code></pre>