Performing a shallow copy

suggest change

A shallow copy is a copy of a collection without performing a copy of its elements.

>>> import copy
>>> c = [[1,2]]
>>> d = copy.copy(c)
>>> c is d
False
>>> c[0] is d[0]
True

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents