title: How to extend an enum with aliases
body: <p>I have an abstract base class <code>GameNodeState</code> that contains a <code>Type</code> enum:</p>
  <pre class="lang-py prettyprint-override"><code>import abc
  import enum
  
  
  class GameNodeState(metaclass=abc.ABCMeta):
      class Type(enum.Enum):
          INIT = enum.auto()
          INTERMEDIATE = enum.auto()
          END = enum.auto()
  </code></pre>
  <p>The names in the enum are generic because they must make sense for any subclass of <code>GameNodeState</code>. But when I subclass <code>GameNodeState</code>, as <code>GameState</code> and <code>RoundState</code>, I would like to be able to add concrete aliases to the members of <code>GameNodeState.Type</code> if the enum is accessed through the subclass. For example, if the <code>GameState</code> subclass aliases <code>INTERMEDIATE</code> as <code>ROUND</code> and <code>RoundState</code> aliases <code>INTERMEDIATE</code> as <code>TURN</code>, I would like the following behaviour:</p>
  <pre><code>&gt;&gt;&gt; GameNodeState.Type.INTERMEDIATE
  &lt;Type.INTERMEDIATE: 2&gt;
  
  &gt;&gt;&gt; RoundState.Type.TURN
  &lt;Type.INTERMEDIATE: 2&gt;
  
  &gt;&gt;&gt; RoundState.Type.INTERMEDIATE
  &lt;Type.INTERMEDIATE: 2&gt;
  
  &gt;&gt;&gt; GameNodeState.Type.TURN
  AttributeError: TURN
  </code></pre>
  <p>My first thought was this:</p>
  <pre class="lang-py prettyprint-override"><code>class GameState(GameNodeState):
      class Type(GameNodeState.Type):
          ROUND = GameNodeState.Type.INTERMEDIATE.value
  
  
  class RoundState(GameNodeState):
      class Type(GameNodeState.Type):
          TURN = GameNodeState.Type.INTERMEDIATE.value
  </code></pre>
  <p>But enums can't be subclassed.</p>
  <hr />
  <p>Note: there are obviously more attributes and methods in the <code>GameNodeState</code> hierarchy, I stripped it down to the bare minimum here to focus on this particular thing.</p>