Re: Multiple values for one key

2008-08-29 Thread Willi Richert
Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique

Re: Multiple values for one key

2008-08-28 Thread Maric Michaud
Le Thursday 28 August 2008 03:43:16 norseman, vous avez écrit : Terry Reedy wrote: Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also

Re: Multiple values for one key

2008-08-28 Thread Bruno Desthuilliers
norseman a écrit : Terry Reedy wrote: Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries

Re: Multiple values for one key

2008-08-28 Thread Tim Rowe
2008/8/28 Bruno Desthuilliers [EMAIL PROTECTED]: You can either use 1/ a list of dicts, or 2/ a dict mapping keys to lists. 1/ records = [ {name:guy, address:unknown,zip:0}, {name:girl, address:123 tiny street,zip:12345}, {name:boy, address:321 here,zip:3}, {name:gal,

Re: Multiple values for one key

2008-08-28 Thread Ron Brennan
wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique. tjr -- http

Re: Multiple values for one key

2008-08-28 Thread Chris Rebert
Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique. tjr

Multiple values for one key

2008-08-27 Thread Ron Brennan
Hello, How would I create a dictionary that contains multiple values for one key. I'd also like the key to be able to have duplicate entries. Thanks, Ron -- FYI, my email address is changing. My rogers account will be deactivated shortly. From now on please use: [EMAIL PROTECTED] -- http

Re: Multiple values for one key

2008-08-27 Thread Fredrik Lundh
Ron Brennan wrote: How would I create a dictionary that contains multiple values for one key. I'd also like the key to be able to have duplicate entries. look for the thread titled python multimap. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple values for one key

2008-08-27 Thread Terry Reedy
Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique

Re: Multiple values for one key

2008-08-27 Thread Maric Michaud
Le Thursday 28 August 2008 01:56:54 Terry Reedy, vous avez écrit :  I'd also like the key to be able to have duplicate entries. Dict keys must be hashable and unique. Let's admit they don't have to be unique (it's easy to implement all sort of data structures in pure python), but what would

Re: Multiple values for one key

2008-08-27 Thread norseman
Terry Reedy wrote: Ron Brennan wrote: Hello, How would I create a dictionary that contains multiple values for one key. Make the value a collection object (set or list if you plan to add and delete). I'd also like the key to be able to have duplicate entries. Dict keys must