Data structure question

Dave Angel davea at
Mon Nov 18 04:25:03 CET 2013

On Mon, 18 Nov 2013 02:03:38 +0000, "Joseph L. Casale" 
<jcasale at> wrote:
> I have a need for a script to hold several tuples with three 
values, two text
> strings and a lambda. I need to index the tuple based on either of 
the two
> strings. Normally a database would be ideal but for a 
self-contained script
> that's a bit much.

How about two dictionaries, each containing the same tuples for 
values? If you create a tuple first, then add it to both dicts, you 
won't have any space-wasting duplicates.


More information about the Python-list mailing list