title: Strange python's hashlib.md5 behavior, different hash each time
body: <p>I've faced some really strange behavior trying to calculate md5 hash of string. Returned hash is always wrong (and different) if I pass string that was result of concatenation. Only way to get real hash I've found is to pass string that wasn't modified in any way after creation.</p>
  
  <pre><code>Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import hashlib
  &gt;&gt;&gt; m = hashlib.md5() 
  &gt;&gt;&gt; a1 = "stack"
  &gt;&gt;&gt; a2 = "overflow"
  &gt;&gt;&gt; a3 = a1 + a2
  &gt;&gt;&gt; a4 = str(a1 + a2)
  &gt;&gt;&gt; m.update("stackoverflow")
  &gt;&gt;&gt; m.hexdigest()
  '73868cb1848a216984dca1b6b0ee37bc' //actuall hash
  &gt;&gt;&gt; m.update(a1 + a2)
  &gt;&gt;&gt; m.hexdigest()
  '458b7358b9e0c3f561957b96e543c5a8'
  &gt;&gt;&gt; m.update(a3)
  &gt;&gt;&gt; m.hexdigest()
  '65b0e62d4ff2d91e111ecc8f27f0e8f5'
  &gt;&gt;&gt; m.update(a4)
  &gt;&gt;&gt; m.hexdigest()
  '60c3ae3dd9a2095340b2e024194bad3c'
  &gt;&gt;&gt; m.update(a1 + a2)
  &gt;&gt;&gt; m.hexdigest()
  'acd4e14145d34dcb10af785badf8e73e'
  &gt;&gt;&gt; m.update(a1 + a2)
  &gt;&gt;&gt; m.hexdigest()
  '03c06ca09faa26166f1096db02272b11'
  &gt;&gt;&gt; a1 + a2 == a1 + a2
  True
  &gt;&gt;&gt; a1 + a2 == a3
  True
  &gt;&gt;&gt; a3 == a4
  True
  </code></pre>
  
  <p>Am I missing something?</p>