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


Groups > comp.lang.python > #59829

Re: Data structure question

Path csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'strings.': 0.09; 'subject:question': 0.10; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tuple': 0.16; 'values?': 0.16; 'index': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'normally': 0.19; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'script': 0.25; 'first,': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'ideal': 0.29; 'tuples': 0.31; 'text': 0.33; 'but': 0.35; 'add': 0.35; 'much.': 0.36; 'two': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'how': 0.40; 'containing': 0.69; 'received:myvzw.com': 0.84; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Data structure question
Date Sun, 17 Nov 2013 21:25:03 -0600
References <assp.0034391b4d.59801e3624744664a94df7ce497b41ad@exch.activenetwerx.com> <assp.0034391b4d.59801e3624744664a94df7ce497b41ad@exch.activenetwerx.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 135.sub-70-208-163.myvzw.com
In-Reply-To <assp.0034391b4d.59801e3624744664a94df7ce497b41ad@exch.activenetwerx.com>
User-Agent Groundhog Newsreader for Android
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2819.1384745107.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384745107 news.xs4all.nl 15936 [2001:888:2000:d::a6]:57877
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59829

Show key headers only | 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