title: Learn Python the Hard Way, Ex 49 : Comparing objects using assert_equal
body: <p>Is it possible to use assert_equal to compare objects? I keep seeing this error:</p>
  
  <pre><code>AssertionError: &lt;ex49.parser.Sentence object at 0x01F1BAF0&gt; !=
  &lt;ex49.parser.Sentence object at 0x01F1BB10&gt;
  </code></pre>
  
  <p>The relevant code fragment:</p>
  
  <pre><code>def test_parse_subject():
  
      testsentence = "princess go east"
      result = lexicon.scan(testsentence)
      Sent = parse_sentence(result)
      ResultSent = Sentence(('subject', 'princess'),
                        ('verb', 'go'),
                        ('object', 'east'))
      print ResultSent.subject
      print ResultSent.verb
      print ResultSent.object
      print Sent.subject
      print Sent.verb
      print Sent.object
      assert_equal(Sent, ResultSent)
  </code></pre>
  
  <p>The print outputs on screen suggests that the objects have the same contents - yet the assertion error shows up. Why is this? Is there some way to use assert_equal to override this?</p>