Vladimir

21%
Flag icon
However, using the constructor or [:] produces a shallow copy (i.e., the outermost container is duplicated, but the copy is filled with references to the same items held by the original container). This saves memory and causes no problems if all the items are immutable. But if there are mutable items, this may lead to unpleasant surprises.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview