title: How to check if class has custom __hash__ implemented
body: <p>I need a method to get object's hash which would be consistent across runs.</p>
  <p>Currently, I'm using the following approach:</p>
  <ol>
  <li>Convert object to bytes using <code>pickle.dumps()</code></li>
  <li>Calculate hash using one of the functions from <code>hashlib</code></li>
  </ol>
  <p>This works fine for most objects, but <code>pickle.dumps</code> can be quite slow.
  For such cases, I can define custom <code>__hash__</code> function for the required classes.</p>
  <p>Is there a way for me to detect when a class has defined a custom <code>__hash__</code> function, so I can use it instead?</p>