> I have a large list of objects which I'd like to filter on various criteria. > For example, I'd like to do something like: > give me all objects o where o.a == "A" and o.b == "B" and o.c in [...]
If space complexity is an issue, you might want to see if using a Bloom filter makes your day. http://en.wikipedia.org/wiki/Bloom_filter B and B+ trees might help, but if you are checking lots of ranges eg. that o.a > 3 and o.a <= 10 R-trees might be show better performance. Postgres has a good indexing plugin called GiST if you want to go down the databases route, but I don't know if that's overkill for your problem. YMMV, HTH. -- steev http://www.daikaiju.org.uk/~steve/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Python Ireland" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.ie/group/pythonireland?hl=en -~----------~----~----~----~------~----~------~--~---
