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


Groups > comp.lang.python > #82083

Re: Nested dictionaries from a list ?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: Nested dictionaries from a list ?
Date Sun, 7 Dec 2014 23:52:47 +0000 (UTC)
Organization A noiseless patient Spider
Lines 19
Message-ID <m62p8f$fn7$3@dont-email.me> (permalink)
References <72066852-b4a1-4820-b52a-be56f68a0d7b@googlegroups.com> <mailman.16678.1417971703.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Sun, 7 Dec 2014 23:52:47 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="66ffcfa4470a58bcddbdcd1913f98ab4"; logging-data="16103"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pkxjSZF0KxxF+HQwWdC/FzJqe9zgC3Vs="
User-Agent Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2)
Cancel-Lock sha1:LBOlXCiQgN0cy6f7Vkjg9yDgry4=
Xref csiph.com comp.lang.python:82083

Show key headers only | View raw


On Sun, 07 Dec 2014 12:01:26 -0500, Dave Angel wrote:

> On 12/07/2014 11:18 AM, Wacky wrote:

>> I've a list of users ....

> I haven't run this through the Python, so please forgive any typos.

> users = [ ....
> mess = { ....

users is redundant, as it's mess.keys()

maintaining a separate list of users and having the users as the keys in 
mess suggests redundancy, and the potential for errors if the two data 
items get out of synch. Better imo to just have the data in one place.

-- 
Denis McMahon, denismfmcmahon@gmail.com

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


Thread

Nested dictionaries from a list ? Wacky <waqar.hafiz@gmail.com> - 2014-12-07 08:18 -0800
  Re: Nested dictionaries from a list ? Dave Angel <davea@davea.name> - 2014-12-07 12:01 -0500
    Re: Nested dictionaries from a list ? Denis McMahon <denismfmcmahon@gmail.com> - 2014-12-07 23:52 +0000
      Re: Nested dictionaries from a list ? Dave Angel <davea@davea.name> - 2014-12-08 08:35 -0500
  Re: Nested dictionaries from a list ? Denis McMahon <denismfmcmahon@gmail.com> - 2014-12-07 23:49 +0000

csiph-web