title: How to check if an object's fields have changed in Python?
body: <p>I have class like this:</p>
  
  <pre><code>class Point(object):
      def __init__(self, x, y):
          self.x = x
          self.y = y
  </code></pre>
  
  <p>I create an instance of this class by:</p>
  
  <pre><code>p1 = Point(5, 10)
  </code></pre>
  
  <p>I want to know if any field of this class was changed. I suppose that there can be some kind of hash function which results I can compare.</p>
  
  <p>For example, in bash I can write <code>md5sum &lt;&lt;&lt;"string"</code>, <code>md5sum &lt;&lt;&lt;"string"</code> in order to get <code>x</code>, <code>y</code> respectively. Then I can compare <code>x</code> and <code>y</code> to find out if they are different or not. </p>
  
  <p>Is there an analogous method which works on Python's object?</p>