Data structure question
Dave Angel
davea at davea.name
Sun Nov 17 22:25:03 EST 2013
On Mon, 18 Nov 2013 02:03:38 +0000, "Joseph L. Casale"
<jcasale at activenetwerx.com> 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.
--
DaveA
More information about the Python-list
mailing list