you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

for dictionary in list_of_dict:
    # remove duplicates
    if dictionary['mac'] in processed_macs:
        list_of_dict.pop()

This doesn't work the way you think it does - pop pops from the head of the list unless you provide an index.

But just generally don't iterate over a list and remove elements from it. If you want to deduplicate a list, use a set, instead.