the hash of the 3 items 1, 1.0, True
is the same (it equals 1
). that's what python uses as the key for dictionaries if there are no collisions. and as 1 == 1.0 == True
is also True
there are no collisions.
here are more details about the old implementation of python dictionaries. the new implementation does things along those lines (but preserves the order).