title: Get user-defined class attributes from class instance
body: <p>How to get user-defined class attributes from class instance? I tried this:</p>
  
  <pre><code>class A:
      FOO = 'foo'
      BAR = 'bar'
  
  a = A()
  
  print(a.__dict__)  # {}
  print(vars(a))  # {}
  </code></pre>
  
  <p>I use python 3.5.
  Is there a way to get them?
  I know that <code>dir(a)</code> returns a list with names of attributes, but I need only used defined, and as a dict name to value.</p>