Steven D'Aprano steve+comp.lang.python at
Fri Feb 10 02:24:57 CET 2012

On Thu, 09 Feb 2012 09:35:52 -0700, Ian Kelly wrote:

> On Thu, Feb 9, 2012 at 8:19 AM, Nathan Rice
> <nathan.alexander.rice at> wrote:
>> As I said, two dictionaries created from the same input will be the
>> same...
> That's an implementation detail, not a guarantee.  It will hold for
> current versions of CPython but not necessarily for other Python
> implementations.

That day may be sooner than you think. It is very likely that in Python 
3.3, dict order will be randomized on creation as a side-effect of adding 
a random salt to hashes to prevent a serious vulnerability in dicts.

If there is anyone still assuming that dicts have a predictable order, 
they're going to be in for a nasty surprise one of these days.


More information about the Python-list mailing list