&quot;why did you enable the -R flag?&quot;<p>Because either the documentation means to include -R in the description, in which case your interpretation of the documentation is incorrect, or the documentation is incomplete because it doesn&#x27;t describe a valid CPython 2.x run-time. Either way, it indicates that the difference isn&#x27;t, strictly speaking, a Python2&#x2F;3 issue.<p>&quot;an arbitrary order&quot;<p>Where does it say that the arbitrary order must be consistent across multiple invocations? Quoting from <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;using&#x2F;cmdline.html#cmdoption-R" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;using&#x2F;cmdline.html#cmdoption-R</a> :<p>&gt; Changing hash values affects the order in which keys are retrieved from a dict. Although Python has never made guarantees about this ordering (and it typically varies between 32-bit and 64-bit builds), enough real-world code implicitly relies on this non-guaranteed behavior that the randomization is disabled by default.<p>I totally understand your point. I remember the debates about how this would break code. But it&#x27;s there to mitigate algorithmic complexity attacks against an every increasing attack surface. This was the best solution they come up with, along with a migration path to the new default.