You might expect a Python dictionary to be sorted by keys like, for example, a C++ std::map, but this is not the case:
myDict = {'first': 1, 'second': 2, 'third': 3}
print(myDict)
# Out: {'first': 1, 'second': 2, 'third': 3}
print([k for k in myDict])
# Out: ['second', 'third', 'first']
Py...