Re: add indexes on the fly to lists

2005-01-26 Thread Diez B. Roggisch
> If you want only "search and found" element, look dictionnary ; if you > want also to have the order, see the module set. Erg - no. Sets are mathematically defined as having no order. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: add indexes on the fly to lists

2005-01-25 Thread Do Re Mi chel La Si Do
Hi ! If you want only "search and found" element, look dictionnary ; if you want also to have the order, see the module set. Good night -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: add indexes on the fly to lists

2005-01-24 Thread Diez B. Roggisch
The data structure you want to use is a dictionary - known as hashmap or hash or map in other languages. Lets say you have a few objects of type town that you want to access using their zip, then things could look like this: class Town(object): def __init__(self, zip, cool_clubs):

add indexes on the fly to lists

2005-01-24 Thread Gabriel B.
I wanted to make a list index work as the index of the data in the database. something like database: idx item_description item_value being imported to my program as: x[idx][0]= item_description x[idx][1]= item_value the problem is that there will be some hundred items and possible the idx wil v