copy
Table of Contents
Overview
- It does "copy" functions and classes
- Use
dict.copy()
orlist[:]
to create a shallow copy ofdict
andlist
- Classes can define special methods
__copy__()
and__deepcopy__()
- shallow
inserts references into a new object to the objects found in the original.
- deep
recursively inserts copies into a new object of the objects found in the original. Recursive objects may cause a recursive loop.