Re: dictionnaries and lookup tables

2005-10-11 Thread m . barenco
Ok, Thanks for your answers, that's pretty unambiguous. M. -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionnaries and lookup tables

2005-10-11 Thread Steven D'Aprano
On Tue, 11 Oct 2005 11:50:24 -0700, m.barenco wrote: > Just to build up on that, when I run: > > #start of listing > import random > > A={1:None,2:None,"hello":None,(1,2,3):None} > > def dictcomp(n): > for i in range(n): > B=A.copy() > C=A.copy() >

Re: dictionnaries and lookup tables

2005-10-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: >>Sure they're implemented. > > > Oops, my apologies. > > Just to build up on that, when I run: > > #start of listing > import random > > A={1:None,2:None,"hello":None,(1,2,3):None} > > def dictcomp(n): > for i in range(n): > B=A.copy() >

Re: dictionnaries and lookup tables

2005-10-11 Thread m . barenco
>Sure they're implemented. Oops, my apologies. Just to build up on that, when I run: #start of listing import random A={1:None,2:None,"hello":None,(1,2,3):None} def dictcomp(n): for i in range(n): B=A.copy() C=A.copy() b=random.uniform(0,

Re: dictionnaries and lookup tables

2005-10-11 Thread gry
[EMAIL PROTECTED] wrote: > Hello, > > I am considering using dictionnaries as lookup tables e.g. > > >>>D={0.5:3.9,1.5:4.2,6.5:3} > > and I would like to have a dictionnary method returning the key and > item of the dictionnary whose key is smaller than the input of the > method (or <=,>,>=) but m

Re: dictionnaries and lookup tables

2005-10-11 Thread jepler
On Tue, Oct 11, 2005 at 11:06:32AM -0700, [EMAIL PROTECTED] wrote: > Note that when I type: > >>>dir(D) [...] > the functions __ge__, __gt__, __lt__, __le__ seem to be non-implemented > but there is some __doc__ in them. Is there the intention to do > something similar as is described above or are

dictionnaries and lookup tables

2005-10-11 Thread m . barenco
Hello, I am considering using dictionnaries as lookup tables e.g. >>>D={0.5:3.9,1.5:4.2,6.5:3} and I would like to have a dictionnary method returning the key and item of the dictionnary whose key is smaller than the input of the method (or <=,>,>=) but maximal (resp. maximal,minimal,minimal) eg