Aug-09-2023, 06:26 PM
if two dictionaries have exactly the same key and value pairs but also have a different insertion order as shown by this little test code:
is this (ignoring insertion order when comparing dictionaries) guaranteed to be so for all compliant interpreters?
what is the appropriate way to compare the insertion order of two dictionaries?
what is the appropriate way to compare the insertion order of two dictionaries even if their values are different (even though the keys are the same with the insertion order being either the same or different)?
dx = {} dx['a'] = 1 dx['b'] = 2 dx['c'] = 3 dy = {} dy['c'] = 3 dy['b'] = 2 dy['a'] = 1 print(dx==dy)the result is True when run on my CPython 3.8.10.
is this (ignoring insertion order when comparing dictionaries) guaranteed to be so for all compliant interpreters?
what is the appropriate way to compare the insertion order of two dictionaries?
what is the appropriate way to compare the insertion order of two dictionaries even if their values are different (even though the keys are the same with the insertion order being either the same or different)?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.