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


Groups > comp.lang.python > #59829 > unrolled thread

Re: Data structure question

Started byDave Angel <davea@davea.name>
First post2013-11-17 21:25 -0600
Last post2013-11-17 21:25 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#59829 — Re: Data structure question

FromDave Angel <davea@davea.name>
Date2013-11-17 21:25 -0600
SubjectRe: Data structure question
Message-ID<mailman.2819.1384745107.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web