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


Groups > comp.lang.python > #10633

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <chris@rebertia.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.046
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'am,': 0.13; 'wrote:': 0.15; '(unlike': 0.16; '11:36': 0.16; 'dictionaries': 0.16; 'subject: \n ': 0.16; 'subject:database': 0.16; 'subject:wrong': 0.16; 'static': 0.16; 'cc:addr:python-list': 0.16; 'cheers,': 0.19; 'cc:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'dictionary': 0.23; 'vs.': 0.23; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.30; 'sun,': 0.30; 'tuples': 0.30; 'subject:?': 0.31; 'named': 0.32; 'chris': 0.32; 'andrew': 0.32; 'instead': 0.34; 'typical': 0.35; 'another': 0.38; 'received:google.com': 0.38; 'received:209.85.161': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'sets': 0.39; 'received:209': 0.40; 'your': 0.60; '31,': 0.64; 'sender:addr:chris': 0.84; 'skip:q 30': 0.84; 'subject:should': 0.84; 'url:rebertia': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FpYzbnPn84c9r8QU0nhNgesRX0n5QVjQly/+un912dM=; b=RZ032KkXFaPBFTipyfP2jMw5oNC1VuvW7NFxccQ5Uzz/PLDQFxhz1EQGIp1hcHpzb8 Nw9dWhOQMmNJ8HW2klVkhIZQP/IQTO2pW9EZh+4v7YKNrWSqdJEQHa5PZd2KG6u7pAE1 XEvU12FWNh5x6s4he+R+Ks+ADlwWtmy6dMsa8=
MIME-Version 1.0
Sender chris@rebertia.com
In-Reply-To <4E35A0BB.5010201@gmail.com>
References <CAJ+TeoevaLW+PxixdLj9+tDkMZcGoxnp51K3PKWHQx4bbZt4Mg@mail.gmail.com> <mailman.1684.1312081856.1164.python-list@python.org> <MPG.289f25a5bb16d26998983f@news.individual.de> <4E35A0BB.5010201@gmail.com>
Date Sun, 31 Jul 2011 12:51:20 -0700
X-Google-Sender-Auth NWQzOcpuis-img2EFAEr4KzGbBs
Subject Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?
From Chris Rebert <clp2@rebertia.com>
To Andrew Berg <bahamutzero8825@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc "comp.lang.python" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1699.1312141884.1164.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1312141884 news.xs4all.nl 23965 [2001:888:2000:d::a6]:38116
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10633

Show key headers only | View raw


On Sun, Jul 31, 2011 at 11:36 AM, Andrew Berg <bahamutzero8825@gmail.com> wrote:
> On 2011.07.31 02:41 AM, Thorsten Kampe wrote:
<snip>
>> Another approach would be named tuples instead of dictionaries or flat
>> SQL tables.
> What would the advantage of that be?

Less punctuation noise:
QueueItem.x264.avs.filter.fft3d.ffte
vs.
QueueItem.x264['avs']['filter']['fft3d']['ffte']

It would also make clear that your sets of "keys" are static (unlike
typical dictionary usage).

Cheers,
Chris
--
http://rebertia.com

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


Thread

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-30 22:10 -0500
  Re: Deeply nested dictionaries - should I look into a database or   am I just doing it wrong? Thorsten Kampe <thorsten@thorstenkampe.de> - 2011-07-31 09:41 +0200
    Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-31 13:36 -0500
      Re: Deeply nested dictionaries - should I look into a database or   am I just doing it wrong? Thorsten Kampe <thorsten@thorstenkampe.de> - 2011-07-31 22:04 +0200
        Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Philip Semanchuk <philip@semanchuk.com> - 2011-07-31 16:53 -0400
        Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-31 17:26 -0500
          Re: Deeply nested dictionaries - should I look into a database or   am I just doing it wrong? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-08-01 18:29 +1200
    Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Chris Rebert <clp2@rebertia.com> - 2011-07-31 12:51 -0700
    Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-31 15:34 -0500
      Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? BlueBird <phil@freehackers.org> - 2011-08-02 02:17 -0700

csiph-web