Re: find a specified dictionary in a list

2005-07-23 Thread Steven D'Aprano
On Fri, 22 Jul 2005 12:42:04 +, Odd-R. wrote: > On 2005-07-22, John Machin <[EMAIL PROTECTED]> wrote: >> Odd-R. wrote: >>> I have this list: >>> >>> [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] >>> >>> All the dictionaries of this list are of the same form, and a

Re: find a specified dictionary in a list

2005-07-22 Thread Christopher Subich
Odd-R. wrote: > On 2005-07-22, John Machin <[EMAIL PROTECTED]> wrote: > > Odd-R. wrote: > >> I have this list: > >> > >> [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] > >> > >> All the dictionaries of this list are of the same form, and all the oids > >> are distinct.

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
Odd-R. Hogstad wrote (in private e-mail, with scarcely private contents): In comp.lang.python, you wrote: Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same fo

Re: find a specified dictionary in a list

2005-07-22 Thread Odd-R.
On 2005-07-22, John Machin <[EMAIL PROTECTED]> wrote: > Odd-R. wrote: >> I have this list: >> >> [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] >> >> All the dictionaries of this list are of the same form, and all the oids >> are distinct. If I have an oid and the list,

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
John Machin wrote: > Odd-R. wrote: > >> I have this list: >> >> [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] >> >> All the dictionaries of this list are of the same form, and all the oids >> are distinct. If I have an oid and the list, how is the simplest way of >> get

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
Odd-R. wrote: > I have this list: > > [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] > > All the dictionaries of this list are of the same form, and all the oids > are distinct. If I have an oid and the list, how is the simplest way of > getting the dictionary that hold