Skip to content

Glossary: Python Beyond the Basics

mutable / immutable

Also written: mutable, immutable

Mutable values (lists, dicts, sets) can be changed in place; immutable ones (numbers, strings, tuples) can't, so operations on them make a new value. Sharing a mutable object between names can cause surprises.

Where the book teaches it

Related terms

objectshallow copy