<story><title>PEP 435 Accepted – Adding an Enum type to the Python standard library</title><url>http://www.python.org/dev/peps/pep-0435/</url></story><parent_chain></parent_chain><comment><author>e1ven</author><text>Can someone help me understand how this helps?
I&apos;m only a mediocre programmer, and I&apos;m having trouble understanding the implications.&lt;p&gt;It seems like you declare these like any other class.
So what&apos;s the difference between this, and creating a class full of ints?&lt;p&gt;If I have class Color:
red = 1
blue = 2&lt;p&gt;etc, wouldn&apos;t I get the same thing?&lt;p&gt;Is the difference that you don&apos;t need to instantiate an instance of it?&lt;p&gt;I know I&apos;m being dense, and I&apos;ve read the PEP, but it&apos;s not quite clicking yet.</text></comment>
<story><title>PEP 435 Accepted – Adding an Enum type to the Python standard library</title><url>http://www.python.org/dev/peps/pep-0435/</url></story><parent_chain></parent_chain><comment><author>comex</author><text>The syntax strikes me as somewhat strange.  It requires writing out enum values (and thus avoiding duplicates or, for a cleaner look, just keeping them sorted), necessitating unnecessary effort when new values are added in the middle, and misleadingly implies that the enum values are merely class-level integer constants.  I would have preferred a more explicit API that used a list of strings for the enumerators.</text></comment>