title: Python equivalent of C# Enum.HasFlag
body: <p>Lets say in python</p>
  
  <pre><code>StateA = 1
  StateB = 2
  StateC = StateA | StateB
  
  ...
  instance.state = StateA
  </code></pre>
  
  <p>in C# there is a HasFlag function in Enum, which tells me an object's flag is part of StateC</p>
  
  <p>Is there a equivalent version in python?</p>
  
  <p>Right now I can only think (as bitwise noob) of this and not even sure if it supposed to work:</p>
  
  <pre><code>if instance.state | StateC == StateC:
      # yes in StateC
  </code></pre>