title: understanding object_pairs_hook in json.loads()
body: <p>In the docs here - <a href="https://docs.python.org/3/library/json.html" rel="noreferrer">https://docs.python.org/3/library/json.html</a></p>
  
  <p>it says of <code>object_pairs_hook</code>: </p>
  
  <blockquote>
    <p>object_pairs_hook is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of object_pairs_hook will be used instead of the dict. This feature can be used to implement custom decoders. If object_hook is also defined, the object_pairs_hook takes priority.</p>
  </blockquote>
  
  <p>There is one rather impressive example of it in <a href="https://stackoverflow.com/a/38307621/4288043">this answer</a>.</p>
  
  <p>I don't understand what a "hook" is or how this feature works. The docs don't really explain it very clearly. I would like to write one now (otherwise it will be a mess of string methods on the string I am parsing)</p>
  
  <p>Does anyone know of a tutorial on this feature or understand it well enough to explain in detail how it works? They seem to assume in the docs that you know what is going on in the black box of <code>json.loads()</code></p>