Here is some example code:

d = {"a":"hello", "b":[1, 2, 3]}

x = d.copy()
d["b"][0]=10
print x

output:
{'a': 'hello', 'b': [10, 2, 3]}

It looks like the key names of a dictionary store pointers to the
values?  Or does a dictionary object manage pointers to keys and
values, so copy() above just copies 4 pointers?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to