Re: reverse dict lookup & Relation class

2009-01-17 Thread Aaron Brady
On Jan 17, 10:45 am, Steven D'Aprano wrote: > On Sat, 17 Jan 2009 00:24:21 -0800, Aaron Brady wrote: > > Can you make it work for a 3-way lookup? > > What do you mean "3-way lookup"? > > I'm going to take a guess... > > A maps to B, B maps to C, and C maps to A. > > Is that what you mean? So long

Re: reverse dict lookup & Relation class

2009-01-17 Thread Steven D'Aprano
On Sat, 17 Jan 2009 00:24:21 -0800, Aaron Brady wrote: > Can you make it work for a 3-way lookup? What do you mean "3-way lookup"? I'm going to take a guess... A maps to B, B maps to C, and C maps to A. Is that what you mean? -- Steven -- http://mail.python.org/mailman/listinfo/python-lis

Re: reverse dict lookup & Relation class

2009-01-17 Thread Aaron Brady
On Jan 16, 5:03 am, Steven D'Aprano wrote: > On Wed, 14 Jan 2009 16:30:36 -0800, Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a Relation class from earlier. > > [...

Re: reverse dict lookup & Relation class

2009-01-16 Thread Steven D'Aprano
On Wed, 14 Jan 2009 16:30:36 -0800, Aaron Brady wrote: > Hi, this is a continuation of something that comes up now and again > about reverse lookups on dictionaries, as well as a follow-up to my > pursuit of a Relation class from earlier. [...] > What's the best way to construct this class? Or,

Re: reverse dict lookup & Relation class

2009-01-16 Thread Aaron Brady
On Jan 14, 7:54 pm, MRAB wrote: > Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a Relation class from earlier. > > > For a reverse lookup, you just need two lookups.

Re: reverse dict lookup & Relation class

2009-01-16 Thread Aaron Brady
On Jan 14, 7:04 pm, Chris Rebert wrote: > On Wed, Jan 14, 2009 at 4:30 PM, Aaron Brady wrote: > > Hi, this is a continuation of something that comes up now and again > > about reverse lookups on dictionaries, as well as a follow-up to my > > pursuit of a Relation class from earlier. snip > > Or,

Re: reverse dict lookup & Relation class

2009-01-14 Thread MRAB
Aaron Brady wrote: Hi, this is a continuation of something that comes up now and again about reverse lookups on dictionaries, as well as a follow-up to my pursuit of a Relation class from earlier. For a reverse lookup, you just need two lookups. name= {} phone= {} name[ '555-963' ]= 'Joan' pho

Re: reverse dict lookup & Relation class

2009-01-14 Thread Chris Rebert
On Wed, Jan 14, 2009 at 4:30 PM, Aaron Brady wrote: > Hi, this is a continuation of something that comes up now and again > about reverse lookups on dictionaries, as well as a follow-up to my > pursuit of a Relation class from earlier. > > For a reverse lookup, you just need two lookups. > name= {

reverse dict lookup & Relation class

2009-01-14 Thread Aaron Brady
Hi, this is a continuation of something that comes up now and again about reverse lookups on dictionaries, as well as a follow-up to my pursuit of a Relation class from earlier. For a reverse lookup, you just need two lookups. name= {} phone= {} name[ '555-963' ]= 'Joan' phone[ 'Joan' ]= '555-963'