Python Language Copying data Performing a shallow copy

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

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


Got any Python Language Question?