(Dec-25-2020, 12:00 AM)ptrivino Wrote: Thank you. The thing I am trying to fix is that when I do this in a third-level function:
for curr_id in dict_1: # loop through the dictionary # code code code dict_1[curr_id].incl_ips.append(ipaddress.ip_network(rng_chop[0] + "/" + str(myprefix), False)) # code code codeit appends the value in the loop iteration to THE SAME dictionary entry.
I'm not sure I follow this part. What are you expecting it to append to?
Quote:Also, from my OP, essentially dict_1_copy is discarded when I exit the function and recreated the next time the function is called?
Yes. I wouldn't use "discarded" here because the actual data remains (since it has another name outside the function). I would say it is "reassigned" the next time the function is called. No data is created at that time.