title: Is there a way to check if two object contain the same values in each of their variables in python?
body: <p>How do I check if two instances of a</p>
  
  <pre><code>class FooBar(object):
      __init__(self, param):
          self.param = param
          self.param_2 = self.function_2(param)
          self.param_3 = self.function_3()
  </code></pre>
  
  <p>are identical? By identical I mean they have the same values in all of their variables.</p>
  
  <pre><code>a = FooBar(param)
  b = FooBar(param)
  </code></pre>
  
  <p>I thought of</p>
  
  <pre><code>if a == b:
      print "a and b are identical"!
  </code></pre>
  
  <p>Will this do it without side effects?</p>
  
  <p>The background for my question is unit testing. I want to achieve something like:</p>
  
  <pre><code>self.failUnlessEqual(self.my_object.a_function(), another_object)
  </code></pre>