I am pickling, compressing, and saving python objects. I want to be able to double-check that that the object I saved is the exact same object that is returned after decompression and depickling. I thought there was an error in my code, but when I boiled the problem down to a reproducible example I found that python does not consider two seemingly identical objects created at two different points in time to be equal. Here is a reproducible example:
class fubar(object):
pass
print(fubar() == fubar())
#False
Why does python consider these two objects to be not equal and what is the most pythonic way to check that two objects are indeed identical?