Is there a better way to get a named series of constants (enumeration) in Python?
<p>Just looking at ways of getting named constants in python.</p>

<pre><code>class constant_list:
    (A_CONSTANT, B_CONSTANT, C_CONSTANT) = range(3)
</code></pre>

<p>Then of course you can refer to it like so:  </p>

<pre><code>constant_list.A_CONSTANT
</code></pre>

<p>I suppose you could use a dictionary, using strings:  </p>

<pre><code>constant_dic = {
    "A_CONSTANT" : 1,
    "B_CONSTANT" : 2,
    "C_CONSTANT" : 3,}
</code></pre>

<p>and refer to it like this:</p>

<pre><code>constant_dic["A_CONSTANT"]
</code></pre>

<p><hr /></p>

<p>My question, then, is simple. Is there any better ways of doing this? Not saying that these are inadequate or anything, just curious - any other common idioms that I've missed?</p>

<p>Thanks in  advance.</p>
