title: Enum of enums in Python?
body: <p>Is it possible to have an enum of enums in Python? For example, I'd like to have </p>
  
  <pre><code>enumA
      enumB
          elementA
          elementB
      enumC
          elementC
          elementD
  </code></pre>
  
  <p>And for me to be able to refer to <code>elementA</code> as <code>enumA.enumB.elementA</code>, or to refer to <code>elementD</code> as <code>enumA.enumC.elementD</code>.</p>
  
  <p>Is this possible? If so, how?</p>
  
  <p>EDIT: When implemented in the naive way:</p>
  
  <pre><code>from enum import Enum
  
  class EnumA(Enum):
      class EnumB(Enum):
          member = 0
  
  print(EnumA)
  print(EnumA.EnumB.member)
  </code></pre>
  
  <p>It gives:</p>
  
  <pre><code>&lt;enum 'EnumA'&gt;
  Traceback (most recent call last):
    File "Maps.py", line 15, in &lt;module&gt;
      print(EnumA.EnumB.member)
  AttributeError: 'EnumA' object has no attribute 'member'
  </code></pre>