title: Getting all constants within a class in python
body: <p>I have a class which is essentially used to define common constants for other classes.  It looks something like the following:</p>
  <pre><code>class CommonNames(object):
      C1 = 'c1'
      C2 = 'c2'
      C3 = 'c3'
  </code></pre>
  <p>And I want to get all of the constant values &quot;pythonically&quot;.  If I used <code>CommonNames.__dict__.values()</code> I get those values (<code>'c1'</code>, etc.) but I get other things such as:</p>
  <pre><code>&lt;attribute '__dict__' of 'CommonNames' objects&gt;,
  &lt;attribute '__weakref__' of 'CommonNames' objects&gt;,
  None ...
  </code></pre>
  <p>Which I don't want.</p>
  <p>I want to be able to grab all the values because this code will be changed later and I want other places to know about those changes.</p>