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 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: References: <72066852-b4a1-4820-b52a-be56f68a0d7b@googlegroups.com> 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 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