Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

Bill Deegan bill at baddogconsulting.com
Sat May 27 20:51:47 EDT 2017


Greetings,

As a follow up to a discussion on IRC #python channel today.

Assuming the same order of insertions of the same items to a dictionary
would the iteration of a dictionary be the same (not as the order of
insertion, just from run to run) for Python 2.7 up to python 3.3? And again
at Python 3.6?
(Also for py 3.3 through 3.5.x if PYTHONHASHSEED=0)

With python 3.6 having the added benefit of guaranteeing insertion order is
maintained?

I was pretty certain this was the case from seeing "Modern Dictionaries by
Raymond Hettinger" talk at SF Python meetup.

https://www.youtube.com/watch?v=p33CVV29OG8

Thanks,
Bill



More information about the Python-list mailing list