title: Python Operator |= meaning
body: <p>due to some versioning problems with python I am bound to use a custom function to compare HMACs (SHA512). To do so I have found this function:</p>
  
  <pre><code>def compare_digest(x, y):
      if not (isinstance(x, bytes) and isinstance(y, bytes)):
          logfile.debug("both inputs should be instances of bytes")
      if len(x) != len(y):
          return False
      result = 0
      for a, b in zip(x, y):
          result |= a ^ b
      return result == 0
  </code></pre>
  
  <p>I am using this in Django, hence I created a logger (logfile) that saves debug messages into a file for me.</p>
  
  <p>The code breaks at this step:</p>
  
  <pre><code>result |= a ^ b
  </code></pre>
  
  <p>However, I have no idea what the |= operator stands for and what happens here. If someone could explain this I could try to rewrite this. </p>
  
  <p>My python version is (unfortunately 2.7.4) with 2.7.7 I would not have the problem, as the function would have been ported correctly and made available.</p>