On Sat, Dec 11, 2010 at 1:26 AM, Alex Hall <mehg...@gmail.com> wrote: > Thanks all! I thought update() would add an item even if it would be a > duplicate, but apparently not. I also now better understand why I am > always passing around *args and **kwargs when calling super(). Very > interesting... >
Actually, it does. If a key is already present, the value will be overwritten (since you can't have a key with more than one value, obviously). If you don't want to overwrite the duplicates, filter them some_dict.update(x for x in additional_dict.items() if x[0] not in some_dict) _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor