Skip to content

Glossary: Python Beyond the Basics

shallow copy

Also written: shallow, copy, copy()

A copy of the outer list or dict only, so mutable items inside it are still shared with the original. `.copy()`, `list(x)` and `x[:]` make shallow copies.

Where the book teaches it

Related terms

deepcopymutable / immutable