title: Is python's "set" stable?
body: <p>The question arose when answering to another SO question (<a href="https://stackoverflow.com/questions/3811794/how-do-i-track-down-a-heisenbug-in-some-python-code/3812011#3812011">there</a>).</p>
  
  <p>When I iterate several times over a python set (without changing it between calls), can I assume it will always return elements in the same order? And if not, what is the rationale of changing the order ? Is it deterministic, or random? Or implementation defined?</p>
  
  <p>And when I call the same python program repeatedly (not random, not input dependent), will I get the same ordering for sets?</p>
  
  <p>The underlying question is if python set iteration order only depends on the algorithm used to implement sets, or also on the execution context?</p>