DanielStutzbach / blist

A list-like type with better asymptotic performance and similar performance on small lists
Other
310 stars 36 forks source link

Make sure that deepcopy is efficient #9

Open DanielStutzbach opened 14 years ago

DanielStutzbach commented 14 years ago

It should copy the internal blist structure, making it very fast when copy-on-write is being heavily used. Observe how list() handles it:

>>> class blah:
...  pass
...
>>> x = blah()
>>> y = [x,x]
>>> z = copy.deepcopy(y)
>>> id(z[0]), id(z[1])
(2146287308, 2146287308)
>>> id(x)
2146287244