title: python enums with attributes
body: <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="https://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 class="lang-java prettyprint-override"><code>enum EnumWithAttrs {
      GREEN(&quot;a&quot;, &quot;b&quot;),
      BLUE(&quot;c&quot;, &quot;d&quot;);
  
      EnumWithAttrs(String a, String b) {
        this.a = a;
        this.b = b;
      }
  
      private String a;
      private String b;
  
      /* accessors and other java noise */
  }
  </code></pre>