title: Testing membership in list of Enum fails
body: <p>I'm trying to check if an Enum is in a list of Enums but it is not working as expected.</p>
  
  <p>If I write the code in a single script and I run it, it works fine:</p>
  
  <pre><code>&gt;&gt;&gt; from enum import Enum
  &gt;&gt;&gt; class X(Enum):
  ...   A = 'a'
  ...   B = 'b'
  ...   C = 'c'
  ...
  &gt;&gt;&gt; s = [X.A, X.B]
  &gt;&gt;&gt; x = X.C
  &gt;&gt;&gt; y = X.B
  &gt;&gt;&gt; x in s
  False
  &gt;&gt;&gt; y in s
  True
  </code></pre>
  
  <p>Yet, in my code, the test doesn't seem to work.
  This is what I added to debug the behavior:</p>
  
  <pre><code>print(type(node.action.kind), node.action.kind)
  print(type(KINDS), type(KINDS[0]), KINDS)
  if node.action.kind in KINDS:
      print('FIRST TEST')
  elif node.action.kind.value in [i.value for i in KINDS]:
      print('SECOND TEST')
  else:
      print('NOT IN KINDS')
  </code></pre>
  
  <p>I would expect it to print <code>FIRST TEST</code> when the condition matches yet the code prints <code>SECOND TEST</code>:</p>
  
  <pre><code>&lt;enum 'ActionKind'&gt; ActionKind.TALK
  &lt;class 'list'&gt; &lt;enum 'ActionKind'&gt; [&lt;ActionKind.CALL: 'api_call'&gt;, &lt;ActionKind.WAIT: 'wait'&gt;, &lt;ActionKind.HANGUP: 'hangup'&gt;]
  NOT IN KINDS
  
  &lt;enum 'ActionKind'&gt; ActionKind.WAIT
  &lt;class 'list'&gt; &lt;enum 'ActionKind'&gt; [&lt;ActionKind.CALL: 'api_call'&gt;, &lt;ActionKind.WAIT: 'wait'&gt;, &lt;ActionKind.HANGUP: 'hangup'&gt;]
  SECOND TEST
  </code></pre>
  
  <p>I can't see any apparent difference other than the enum is defined elsewhere and the list of KINDS is populated from imported constants in another file. What is happening? Why can't I test membership in list of Enum with the <code>in</code> operator?</p>