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
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([
> 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
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