Re: Efficient lookup in list of dictionaries

2005-12-05 Thread David Pratt
This is a lot less clumsy and can easily be used in a class which is very nice! Many thanks bruno and Rob E for this good advice. Regards, David On Monday, December 5, 2005, at 05:31 AM, bruno at modulix wrote: > David Pratt wrote: > (snip) >> Can someone advise a more efficient lookup when usi

Re: Efficient lookup in list of dictionaries

2005-12-05 Thread bruno at modulix
David Pratt wrote: (snip) > Can someone advise a more efficient lookup when using lists of > dictionaries. Many thanks. > > > TEST_CONSTANTS = [ > {'color':'red', 'shape':'octagon'}, > {'color':'yellow', 'shape':'triangle'}, > {'color':'green', 'shape':'circle'}] COLOR_INDEX = dict([

Re: Efficient lookup in list of dictionaries

2005-12-04 Thread Rob E
> Hi. I like working with lists of dictionaries since order is preserved > in a list when I want order and the dictionaries make it explicit what > I have got inside them. I find this combination very useful for storing > constants especially. Generally I find myself either needing to > retriev

Efficient lookup in list of dictionaries

2005-12-04 Thread David Pratt
Hi. I like working with lists of dictionaries since order is preserved in a list when I want order and the dictionaries make it explicit what I have got inside them. I find this combination very useful for storing constants especially. Generally I find myself either needing to retrieve the valu