title: Check variable equality against a list of values
body: <p>I'm checking a variable, say <code>foo</code>, for equality to a number of values. For example,</p>
  
  <pre><code>if( foo == 1 || foo == 3 || foo == 12 ) {
      // ...
  }
  </code></pre>
  
  <p>The point is that it is rather much code for such a trivial task. I came up with the following:</p>
  
  <pre><code>if( foo in {1: 1, 3: 1, 12: 1} ) {
      // ...
  }
  </code></pre>
  
  <p>but also this does not completely appeal to me, because I have to give redundant values to the items in the object.</p>
  
  <p>Does anyone know a decent way of doing an equality check against multiple values?</p>