Hi all! I'm wondering whether there is some form of number set type implemented in pure Python. I'm currently in the process of implementing one myself (for an IPv4 address range type), and if there's some form of reference implementation I'd love to see it. I've not found a reasonably complete implementation anywhere so far.
To explain what I mean with number set: a set type that doesn't store individual entries but as it only contains numbers can store ranges of numbers. Basically what it boils down to is implementing intersection reasonably fast, because all other set operations can be reduced to intersection and union (which is easy to implement). I have implementations for both, but only union is fast with O(n), intersection is currently O(n^2). But, anyway, if anybody knows of some implementation I can have a look at, please let me know. Thanks! --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list