title: What is a fast pythonic way to deepcopy just data from a python dict or list ?
body: <p>When we need to copy full data from a dictionary containing primitive data types ( for simplicity, lets ignore presence of datatypes like datetime etc), the most obvious choice that we have is to use <code>deepcopy</code>, but deepcopy is slower than some other hackish methods of achieving the same i.e. using serialization-unserialization for example like json-dump-json-load or msgpack-pack-msgpack-unpack. The difference in efficiency can be seen here :</p>
  
  <pre><code>&gt;&gt;&gt; import timeit
  &gt;&gt;&gt; setup = '''
  ... import msgpack
  ... import json
  ... from copy import deepcopy
  ... data = {'name':'John Doe','ranks':{'sports':13,'edu':34,'arts':45},'grade':5}
  ... '''
  &gt;&gt;&gt; print(timeit.timeit('deepcopy(data)', setup=setup))
  12.0860249996
  &gt;&gt;&gt; print(timeit.timeit('json.loads(json.dumps(data))', setup=setup))
  9.07182312012
  &gt;&gt;&gt; print(timeit.timeit('msgpack.unpackb(msgpack.packb(data))', setup=setup))
  1.42743492126
  </code></pre>
  
  <p>json and msgpack (or cPickle) methods are faster than a normal deepcopy, which is obvious as deepcopy would be doing much more in copying all the attributes of the object too. </p>
  
  <p>Question: Is there a more pythonic/inbuilt way to achieve just a data copy of a dictionary or list, without having all the overhead that deepcopy has ?</p>