Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'cpython': 0.05; 'either.': 0.09; 'am,': 0.13; 'wrote:': 0.15; '"."': 0.16; '3.2.1': 0.16; 'class;': 0.16; 'dictionaries': 0.16; 'duplicating': 0.16; 'subject: \n ': 0.16; 'subject:database': 0.16; 'subject:wrong': 0.16; 'thunderbird': 0.16; 'received:209.85.210.174': 0.19; 'received:mail-iy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; 'dictionary': 0.23; 'structure': 0.23; 'windows': 0.26; 'right.': 0.28; 'class.': 0.29; 'id:': 0.29; 'example': 0.30; 'mix': 0.30; 'nested': 0.30; 'tuples': 0.30; 'class': 0.31; 'subject:?': 0.31; "won't": 0.32; 'named': 0.32; 'change.': 0.32; 'message-id:@gmail.com': 0.32; 'does': 0.32; 'to:addr:python- list': 0.34; 'instead': 0.34; 'header:User-Agent:1': 0.34; 'skip:" 50': 0.35; 'another': 0.38; 'received:192': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'think': 0.38; 'received:192.168.1': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'your': 0.60; 'order': 0.62; '5.0': 0.84; 'huh?': 0.84; 'subject:should': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=RTfha1m8VMD5tgeDok8L3cjYH6B4ZJauTdVE4kWuXgo=; b=B0N7P8lGGahhAG/nQjRSWOqXDLGveDVETdqpRJLa322kNh8P3Cm2PmB5e5u8j2l2dJ FiVLavPJExcX0Y3si4qr6CwXPYHqrY7CKiRZg6/kO0ypTvkd1ujlDJ7adGk20qeAjYTh pGCXynPNQPGQDOw8oahiymY54Cp/CaDW8vBIA= Date: Sun, 31 Jul 2011 13:36:43 -0500 From: Andrew Berg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: "comp.lang.python" Subject: Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong? References: In-Reply-To: X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312137417 news.xs4all.nl 23968 [2001:888:2000:d::a6]:49106 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10628 On 2011.07.31 02:41 AM, Thorsten Kampe wrote: > The "QueueItem.x264['avs']['filter']['fft3d']['ffte'])" example does not > look right. Especially the mix of "." and "[]" references. Actually, > dictionaries in a dictionary don't look right to me either. QueueItem is the class; x264 is a dictionary. > The design of your data structure won't change. I would think that your > program already mimicks it by nested class statements so you're > duplicating the already existing class structure via dictionaries in > order to have it available in the main class. Huh? I only have no nested class statements. > Another approach would be named tuples instead of dictionaries or flat > SQL tables. What would the advantage of that be? -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB