DEV Community

[Comment from a deleted post]
Collapse
 
cannuhlar profile image
Can Nuhlar • Edited

I do get the point of your post but dictionaries in python are stored as random anyways. Maybe random is a strong word here but at least we can say they are not guaranteed to be in order. So if you define a dict and just print it, you will see that it is not outputting it in order that you defined.

Edit: According to jpittiglio's reply this is not the case anymore for python 3.7. Please see the SO link below.

Collapse
 
jpittiglio profile image
jpittiglio

No longer true in modern Python - ref: stackoverflow.com/questions/399803...

tl;dr - Dictionaries are insertion ordered as of 3.6 as an implementation detail, and a language feature as of 3.7

Collapse
 
cannuhlar profile image
Can Nuhlar

Did not know that at all. Thanks for the update! :)