title: How to check if string exists in Enum of strings?
body: <p>I have created the following Enum:</p>
  <pre><code>from enum import Enum
  
  class Action(str, Enum):
      NEW_CUSTOMER = &quot;new_customer&quot;
      LOGIN = &quot;login&quot;
      BLOCK = &quot;block&quot;
  </code></pre>
  <p>I have inherited from <code>str</code>, too, so that I can do things such as:</p>
  <pre><code>action = &quot;new_customer&quot;
  ...
  if action == Action.NEW_CUSTOMER:
      ...
  </code></pre>
  <p>I would now like to be able to check if a string is in this Enum, such as:</p>
  <pre><code>if &quot;new_customer&quot; in Action:
      ....
  </code></pre>
  <p>I have tried adding the following method to the class:</p>
  <pre><code>def __contains__(self, item):
      return item in [i for i in self]
  </code></pre>
  <p>However, when I run this code:</p>
  <pre><code>print(&quot;new_customer&quot; in [i for i in Action])
  print(&quot;new_customer&quot; in Action)
  </code></pre>
  <p>I get this exception:</p>
  <pre><code>True
  Traceback (most recent call last):
    File &quot;/Users/kevinobrien/Documents/Projects/crazywall/utils.py&quot;, line 24, in &lt;module&gt;
      print(&quot;new_customer&quot; in Action)
    File &quot;/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py&quot;, line 310, in __contains__
      raise TypeError(
  TypeError: unsupported operand type(s) for 'in': 'str' and 'EnumMeta'
  </code></pre>