Hello list

I'm not a newbie on python but I'm not an expert either and just found out that code like this gives the above exception.

        self.db={}
        self.db["foo"]=[1,2]
        self.db ["bar"]=[2,3]

I now undestand why this is giving me a problem and I think i'm using the wrong approach

first of all I'm trying to test some code which will have diferent backends so I'm doing a quick in memory structure that will let me know that the algoritms are ok.

my data has the following constrains.

I have keywords (foo,bar,etc) and then values (1,2,3,etc.) now each keyword is unique and each value may or maynot be unique, although it should be unique but we won't enforce that.

now one keywords may return 0 to n values which are all the values matching that certain keyword. something similar to a tagging system. We will never access the data based on values and each Source object has a method with the signature get(keyword) where keyword is a string. ohh and the values are all strings too.

does anyone has a good idea on how to implement this (for the test).

thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to