dataList = [a, b, c, ...] where a, b, c are objects of a Class X. In Class X, it contains self.name and self.number
If i wish to test whether a number (let's say 100) appears in one of the object, and return that object, is that only fast way of solving this problem without iterating through every object to see the number value? dataList.__contains__ can only check my object instance name... anyone can solve this in linear complexity? -- http://mail.python.org/mailman/listinfo/python-list