Intersection with BTrees

Thomas Güttler guettler at thomas-guettler.de
Wed May 28 08:24:24 EDT 2003


Andreas Jung wrote:

> see http://www.zope.org/Members/ajung/BTrees/FrontPage

Hi Andreas,

thank you for this link!

I to the multiintersection like this:

        intersect=None
        for value in values:
            value=value.upper()
            result=self.docs.get(value.upper())
            if not result:
                return OOBTree()
            if not intersect:
                intersect=result
            else:
                intersect=intersection(intersect, result)
            print "intersection: %s %s %s" % (value, intersect,      
                                               len(intersect))
        return intersect

Unfortunatley there is no multiintersection, but only a
multiunion. Are there better ways to do this?

  thomas





More information about the Python-list mailing list