title: python on-the-fly md5 as one reads a stream
body: <p>Does python 3 have a structure for making a filtering stream? In particular, my goal here is to calculate an md5 checksum of the contents read from a REST service with requests without making an extra copy. If I could subclass some sort of filter stream and just shove the bytes into a hashlib-derived md5 object I'd be good.</p>
  
  <p>Currently, my code includes:</p>
  
  <pre><code>shutil.copyfileobj(r.raw, outstream)
  </code></pre>
  
  <p>where 'r' is the response object. Can I wrap a generator or some such thing around r.raw that will be called with each buffer of data as read, so that I can then pass it into md5?</p>