title: How is set() implemented?
body: <p>I've seen people say that <code>set</code> objects in python have O(1) membership-checking. How are they implemented internally to allow this? What sort of data structure does it use? What other implications does that implementation have?</p>
  
  <p>Every answer here was really enlightening, but I can only accept one, so I'll go with the closest answer to my original question. Thanks all for the info!</p>