Does orderedDict.values(), .keys(), .iterkeys() etc. returns the values in the order that items were first inserted?
I assume that values\keys function does not change the order of the dict, and if it's orderedDict, then i get the values in the order that they were added to the dictionary.
That's true?
Your assumption is correct.
OrderedDict
maintains a list of (thus ordered) keys to iterate over values and keys, so they will always be ordered the same way as infor
loops.The comments in the source code also states this, saying:
Emphasis mine.