Re: [Tutor] comparing lists of dictionaries

2009-03-09 Thread Kent Johnson
On Mon, Mar 9, 2009 at 5:56 PM, ski wrote: > i was looking to list all the items in list1 that are not in list2 based on > the key['id] and key['affiliation'] respectively. OK. Generally, when you want to test for membership, a set or dict is a good choice. In this case, I would first make a set

Re: [Tutor] comparing lists of dictionaries

2009-03-09 Thread ski
i was looking to list all the items in list1 that are not in list2 based on the key['id] and key['affiliation'] respectively. thanks Kent Johnson wrote: On Mon, Mar 9, 2009 at 4:20 PM, ski wrote: what am i missing here, i would like to get a list of the diff between list1 and list2 What

Re: [Tutor] comparing lists of dictionaries

2009-03-09 Thread Kent Johnson
On Mon, Mar 9, 2009 at 4:20 PM, ski wrote: > what am i missing here, i would like to get a list of the diff between list1 > and list2 What do you mean by diff in this case? Items in one list and not in the other? Items that are in both lists but with different elements? What elements do you wan

[Tutor] comparing lists of dictionaries

2009-03-09 Thread ski
hello again, i am trying to get my head around this but without success, here is what i have so far: >>> list1 = [{'is_selected': False, 'id': 'AAC', 'title': 'Association of Airline Cons.'}, {'is_selected': False, 'id': 'AALA', 'title': 'Adv. Activity Licence. Auth.'}, {'is_selected': False,