title: if a == b or a == c: vs if a in {b, c}:
body: <p>In my code I used to have comparisons like <code>if a == b or a == c or a == d:</code> fairly frequently. At some point I discovered that these could easily be shortened to <code>if a in {b, c, d}:</code> or <code>if a in (b, c, d):</code> if the values aren't hashable. However, I have never seen such a construction in anyone else's code. This is probably because either:</p>
  
  <ol>
  <li>The <code>==</code> way is slower.</li>
  <li>The <code>==</code> way is more pythonic.</li>
  <li>They actually do subtly different things.</li>
  <li>I have, by chance, not looked at any code which required either.</li>
  <li>I have seen it and just ignored or forgotten it.</li>
  <li>One shouldn't need to have comparisons like this because one's code sould be better elsewhere.</li>
  <li><del>Nobody has thought of the <code>in</code> way except me.</del></li>
  </ol>
  
  <p>Which reason, if any, is it?</p>