interval arithmetic libraries

srepmub mark.dufour at
Sat Jun 6 08:15:18 EDT 2009

Hi all,

I'm looking for libraries that allow one to calculate with sets of
(date) intervals. So for example, I'd like to be able to calculate the
overlap between two sets of intervals, the union etc. Preferrably,
this works with datetime objects, is written in pure Python, and has
reasonably good (algorithmic) performance. The neatest library I've
found so far is this one:

>From an API standpoint, it looks rather nice, but the performance
could be better (for example, calculating an overlap now involves
looping quadratically over both interval sets), and it doesn't work
fully with datetime objects (Inf doesn't work).

Thanks for any pointers,
Mark Dufour.
(author of Shedskin, an experimental (restricted-)Python-to-C++

More information about the Python-list mailing list