Nested dictionaries from a list ?

Denis McMahon denismfmcmahon at gmail.com
Sun Dec 7 18:52:47 EST 2014


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 at gmail.com



More information about the Python-list mailing list