Re: Python newbie data structures question

2009-10-31 Thread codingJoe
On Oct 29, 2:06 am, Chris Rebert wrote: > On Wed, Oct 28, 2009 at 11:31 PM, codingJoe wrote: > > Hi all! > > > I am trying to choose the right data structure to do a value lookup > > with multiple keys. > > > I want to lookup data by:  key, key,{ values } > > > My final product should be able to

Re: Python newbie data structures question

2009-10-29 Thread Chris Rebert
On Wed, Oct 28, 2009 at 11:31 PM, codingJoe wrote: > Hi all! > > I am trying to choose the right data structure to do a value lookup > with multiple keys. > > > I want to lookup data by:  key, key,{ values } > > My final product should be able to reference this datastructure from > within a django

Re: Python newbie data structures question

2009-10-29 Thread alex23
On Oct 29, 4:31 pm, codingJoe wrote: > I am trying to choose the right data structure to do a value lookup > with multiple keys. Hey Joe, Is something like this what you're after? >>> from collections import defaultdict >>> sports = defaultdict(list) >>> sports['winter','indoors'].append('bball

Python newbie data structures question

2009-10-28 Thread codingJoe
Hi all! I am trying to choose the right data structure to do a value lookup with multiple keys. I want to lookup data by: key, key,{ values } My final product should be able to reference this datastructure from within a django template. Because my lookup needs only 80 values and will never c