title: How do you use msgpack to replace copy.deepcopy in Python?
body: <p>According to this post <a href="https://stackoverflow.com/questions/45858084/what-is-a-fast-pythonic-way-to-deepcopy-just-data-from-a-python-dict-or-list">What is a fast pythonic way to deepcopy just data from a python dict or list ?</a> msgpack is 10 times faster than <code>copy.deepcopy</code> but I cannot figure out how to use it. </p>
  
  <p>I tried</p>
  
  <pre><code>item2 = msgpack.unpack(msgpack.packb(item1))
  </code></pre>
  
  <p>In place of:</p>
  
  <pre><code>item2 = copy.deepcopy(item1)
  </code></pre>
  
  <p>But I get </p>
  
  <pre><code>File "msgpack/_unpacker.pyx", line 228, in msgpack._unpacker.unpack
  AttributeError: 'bytes' object has no attribute 'read'
  </code></pre>
  
  <p>The documentation located here <a href="http://msgpack-python.readthedocs.io/en/latest/api.html" rel="nofollow noreferrer">http://msgpack-python.readthedocs.io/en/latest/api.html</a> is incomprehensible but that's no surprise because just about all computer documentation is incomprehensible to me.</p>