Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59829

Re: Data structure question

From Dave Angel <davea@davea.name>
Subject Re: Data structure question
Date 2013-11-17 21:25 -0600
References <assp.0034391b4d.59801e3624744664a94df7ce497b41ad@exch.activenetwerx.com> <assp.0034391b4d.59801e3624744664a94df7ce497b41ad@exch.activenetwerx.com>
Newsgroups comp.lang.python
Message-ID <mailman.2819.1384745107.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, 18 Nov 2013 02:03:38 +0000, "Joseph L. Casale" 
<jcasale@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Data structure question Dave Angel <davea@davea.name> - 2013-11-17 21:25 -0600

csiph-web