Dictionaries as records

Bill Wilkinson bwilk_97 at yahoo.com
Wed Dec 19 16:13:41 CET 2001

"John Roth"
> In this case, you have one copy of each of your input
> strings, not 15000 copies! The memory usage should be
> pretty close to pure dictionary overhead.

I don't see how that can be. If they were all copies of the same reference,
wouldn't a change in one record be reflected in all?  Below I make a change
to one record and the others remain the same:

>>>tbl[1]["g11"]  #original value
>>> tbl[1]["g11"] = "f"  #change rec one to 'f'/
>>> tbl[1]["g11"]    #it's value is different now.
>>> tbl[2]["g11"]    #rec 2 remains the same.

Now the question. Am I misunderstanding what is happening above?

Thank you for your assistance


More information about the Python-list mailing list