"there is really no alternative in the general case without imposing huge overhead, making copies of everything "just in case"."<p>Actually, there is an alternative: use persistent data structures. Granted, it's an alternative that isn't terribly "Pythonic", but an alternative nonetheless.
A terser version with pictures: <a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables" rel="nofollow">http://python.net/~goodger/projects/pycon/2007/idiomatic/han...</a> from "Code Like a Pythonista: Idiomatic Python" by David Goodger
Seems like a very verbose way to explain the situation to the original poster...<p>Lists are mutable, strings aren't. When you reassign one of the dictionary values pointing to an existing string, it can't change that string, so it creates a new one. Since lists can be changed, it doesn't need to create a new one and can modify the existing list.