# shallow-copy

Published articles for shallow-copy.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How Shallow and Deep Copies Work in Python

DevFeed: [How Shallow and Deep Copies Work in Python](<https://devfeed.tech/articles/how-shallow-and-deep-copies-work-in-python-85735.md>)

Original publisher: [Read original article](<https://hackernoon.com/how-shallow-and-deep-copies-work-in-python?source=rss>)

Author: Sohel Alam

Published: 2026-10-12T16:55:52Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [code](<https://devfeed.tech/tags/code.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [deep-copy](<https://devfeed.tech/tags/deep-copy.md>), [mutable-default-arguments](<https://devfeed.tech/tags/mutable-default-arguments.md>), [object-references](<https://devfeed.tech/tags/object-references.md>), [python](<https://devfeed.tech/tags/python.md>), [python-debugging](<https://devfeed.tech/tags/python-debugging.md>), [python-dictionaries](<https://devfeed.tech/tags/python-dictionaries.md>), [python-mutability](<https://devfeed.tech/tags/python-mutability.md>), [python-programming](<https://devfeed.tech/tags/python-programming.md>), [shallow-copy](<https://devfeed.tech/tags/shallow-copy.md>)

### AI overview

This tutorial explains how Python dictionary copies behave when they contain mutable nested objects. A shallow copy duplicates the outer dictionary while sharing references to nested values, so in-place changes can affect both dictionaries. It shows when copy.deepcopy() is useful, why it can cost more memory and time, and how mutable default arguments can cause a similar sharing problem.

### Source excerpt

I copied a Python dictionary, but the original still changed. Here's how shallow copies, shared references, and deep copies actually work.