Set type for datetime intervals

Random832 random832 at fastmail.com
Mon Apr 4 11:19:47 EDT 2016


On Mon, Apr 4, 2016, at 06:15, Nagy László Zsolt wrote:
> If you define the intersection operation on interval sets only, then you
> need to write something like this:
> 
> if IntervalSet(i1)*IntervalSet(i2):
>     pass
> 
> which is both uglier and an overkill.

I guess what I don't understand in this situation is why aren't i1 and
i2 already IntervalSets? I'm not sure I see why user code would be
working directly with Intervals at all. Any use for it could be replaced
with an IntervalSet constructor to directly make a set of one interval.



More information about the Python-list mailing list