Jan-10-2019, 07:23 AM
(Jan-10-2019, 06:03 AM)woooee Wrote: Dictionary keys are hashed, so they are in "hashed" order, not input order.
Your statement suggest there is some kind of order that is preserved, even if it is not the order of insertion. That's not true for python version before 3.6. There is no guarantee that any order will be preserved between different runs of the same script, i.e. if you run the same script multiple times you may get different order. This is more easy to observe with larger dicts. In python 3.6. order of insertion is preserved, but it is considered implementation detail and should no be relied upon. As of 3.7. order of insertion preservation feature is part of official python API. However is not correct to say that
(Jan-10-2019, 06:03 AM)woooee Wrote: the latest version of Python uses an OrderedDict by default.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs