python enums with attributes
<p>Consider:</p>

<pre><code>class Item:
   def __init__(self, a, b):
       self.a = a
       self.b = b

class Items:
    GREEN = Item('a', 'b')
    BLUE = Item('c', 'd')
</code></pre>

<p>Is there a way to adapt the ideas for simple enums to this case? (see <a href="http://stackoverflow.com/questions/36932/whats-the-best-way-to-implement-an-enum-in-python">this question</a>) Ideally, as in Java, I would like to cram it all into one class.</p>

<p>Java model:</p>

<pre><code>enum EnumWithAttrs {
    GREEN("a", "b"),
    BLUE("c", "d");

    EnumWithAttrs(String a, String b) {
      this.a = a;
      this.b = b;
    }

    private String a;
    private String b;

    /* accessors and other java noise */
}
</code></pre>
