I have a dictionary whose keys are tuples like (int, str, int, str, int)
, and the corresponding values are lists of floats of the same size.
I pickled the dictionary twice by the same script:
import pickle
with open(name, 'wb') as source:
pickle.dump(the_dict, source)
For the two resulting binary files test_1
and test_2
, I run
diff test_1 test_2
in a terminal (I'm using macOS) to see whether I can use diff
to tell the difference. However, I received
Binary files test_1 and test_2 differ
Why? Was the same dictionary being pickled in different ways? Does it mean I cannot use diff to tell whether two dictionaries are identical?